配置错误:lapis。Luarocks 可能没有正确配置。

安装 Lapis 遇到了一些问题。我正在 Ubuntu 上工作,每次使用 luarocks 安装方法获取 lapis 时都会出现以下错误。有什么建议吗?

我需要更改哪些设置来更正这个错误: "lpcap.c:6:17: fatal error: lua.h: No such file or directory"

缺少安装 Lapis 的依赖项:
lpeg
luasocket
lua-cjson

使用 https://rocks.moonscript.org/lpeg-0.12-1.src.rock... 切换到 'build' 模式
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"
                 ^
编译已终止。

错误:无法安装依赖项:https://rocks.moonscript.org/lpeg-0.12-1.src.rock - 构建错误:无法编译对象 lpcap.o
bitsguru@ubuntu:~/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"
点赞
用户3677376
用户3677376

问题描述: LuaRocks 找不到 Lua 的头文件。这些文件的位置在 site_config.lua 中被配置为 site_config.LUA_INCDIR, 在Ubuntu上,根据你想要使用的 Lua 版本,应该是 /usr/include/lua5.1/usr/include/lua5.2。相应地修改该值,或者如果没有 site_config.lua(它应该与其他 LuaRocks 模块在同一目录下),你可以通过对 LuaRocks 源代码运行 ./configure 来创建它。

2014-10-05 16:55:36