2014-10-04 77 views
0

在安裝Lapis時遇到了一些麻煩。我在Ubuntu工作,每次使用luarocks安裝方法獲取青金石時都會收到此錯誤....任何建議?配置錯誤天真。 Luarocks可能沒有正確配置

我能在我的設置更改爲更正此錯誤:「lpcap.c:6:17:致命錯誤:lua.h:沒有這樣的文件或目錄」

Missing dependencies for lapis: 
lpeg 
luasocket 
lua-cjson 

Using https://rocks.moonscript.org/lpeg-0.12-1.src.rock... switching to 'build' mode 
gcc -O2 -fPIC -I/usr/include -c lpcap.c -o lpcap.o 
lpcap.c:6:17: fatal error: lua.h: No such file or directory 
#include "lua.h" 
       ^
compilation terminated. 

Error: Failed installing dependency: https://rocks.moonscript.org/lpeg-0.12-1.src.rock - Build error: Failed compiling object lpcap.o 
[email protected]:~/Desktop/me/lapis-master$ 

也許這是一個更好的報告:

os.execute:  cd '/tmp/luarocks_lpeg-0.12-1-8126/lpeg-0.12' && gcc -O2 -fPIC '-I/usr/include' '-c' 'lpcap.c' '-o' 'lpcap.o' 
lpcap.c:6:17: fatal error: lua.h: No such file or directory 
#include "lua.h" 
+0

由於缺少lua-dev/liblua5.1-0-dev(用於ubuntu)包而導致。 – Shanthakumar 2014-12-01 10:43:03

回答

0

LuaRocks找不到Lua包含文件。這些文件的位置在site_config.lua中配置爲site_config.LUA_INCDIR,在Ubuntu上應該爲/usr/include/lua5.1/usr/include/lua5.2,具體取決於您要使用的Lua版本。相應地修改該值,或者如果您沒有site_config.lua(它應該與其他LuaRocks模塊位於同一目錄中),則可以通過在LuaRocks源代碼上運行./configure來創建它。