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

五迷三道 提交于 2019-12-11 07:19:07

问题


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!


回答1:


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




回答2:


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!



来源:https://stackoverflow.com/questions/54813206/error-failed-finding-lua-library-you-may-need-to-configure-lua-libdir

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!