Error: Failed finding Lua library. You may need to

2019-07-24 23:30发布

I am running ubuntu and installed luarocks, however, whenever I try to install a something like luasocket (luarocks install luasocket), it throws me the following error:

Error: Failed finding Lua library. You may need to configure LUA_LIBDIR

Both my config files look like this:

    rocks_trees = {
   { name = "user", root = home .. "/.luarocks" };
   { name = "system", root = "/usr/local" };
}
lua_interpreter = "lua5.3";
variables = {
   LUA_DIR = "/usr/include/lua53";
   LUA_BINDIR = "/usr/bin/lua53";

}

Any help is appreciated!

2条回答
Lonely孤独者°
2楼-- · 2019-07-24 23:54

thanks for the responses, however i got it working by:

uninstalling lua uninstalling luarocks

installing lua5.1 as well as the development version installing luarocks as instructed on luarocks.org

the problem for me was i somehow got lua5.3 as my main lua version, but somehow had other version source files, so i just had to completely delete everything and make sure i download consistent versions. Hope this helps anyone else!

查看更多
一纸荒年 Trace。
3楼-- · 2019-07-25 00:01

You need to add LUA_LIBDIR to the variable it should look something like this:

rocks_trees = { "/usr/local/lib/luarocks/5.1" }
variables = {
   LUA = "/usr/local/opt/lua/bin/lua5.1",
   LUA_BINDIR = "/usr/local/opt/lua/bin",
   LUA_INCDIR = "/usr/local/opt/lua/include",
   LUA_LIBDIR = "/usr/local/opt/lua/lib",
}

Resources for config file:

http://lua-users.org/wiki/LuaRocksConfig

https://github.com/luarocks/luarocks/wiki/Config-file-format

查看更多
登录 后发表回答