Closed bodonkerhoderos closed 3 years ago
This can happen if you've compiled and installed a native module using LuaRocks configured for a later version of Lua (5.4, 5.3, etc.) that you're trying to load into openresty with luajit which is compatible with Lua 5.1 shared libraries only.
Typically LuaRocks will have different install paths for each version of Lua. Ensure that you're installing Lapis with LuaRocks configured for 5.1, and then ensure that OpenResty isn't using incorrect LUA_PATH
, LUA_CPATH
environment variables for a different version of Lua.
You can use the following command to install for Lua 5.1:
luarocks --lua-vesrion=5.1 install lapis
Personally though, I install all my modules using --local
like so: luarocks --local --lua-vesrion=5.1 install lapis
The following command will then show the appropriate environment variables to set the path for the specified version:
luarocks --lua-version=5.1 path
You can override the LUA_PATH
and LUA_CPATH
environment variables directly in your OpenResty config using the lua_package_path
and lua_package_cpath
directives: https://github.com/openresty/lua-nginx-module#lua_package_path
ah perfect thank you! i knew there was something basic i was missing :)
should i draft up a paragraph with this info for the docs in the getting started section?
hey i'm having trouble getting lapis to run the default project .
i have installed openresty and luarocks from AUR and then followed the lapis getting started page but opening it in the browser yields:
(irrelevant but notable that i did have to roll back the lua-cjson version as described in #739)
i guess first question is is there something i'm doing wrong? the error leads me to think that (this version of) lpeg is incompatible with luajit. the rockspec file for lpeg indicates it is compatible with lua 5.1
currently i have lpeg version 1.0.2-1 installed. but i tried walking down the line and couldn't get other versions to work as they either threw the same error or other symbols were undefined.