You are not logged in.
For background, and to run though this yourself, see Getting Started With Lapis.
Running 'lapis server' and opening http://localhost:8080/ results in:
2014/10/20 01:47:01 [error] 29305#0: *1 lua entry thread aborted: runtime error: /home/bdjnk/Projects/LoE/web.lua:1: module 'lapis' not found:
no field package.preload['lapis']
no file '/usr/local/openresty/lualib/lapis.lua'
no file '/usr/local/openresty/lualib/lapis/init.lua'
no file './lapis.lua'
no file '/usr/local/openresty/luajit/share/luajit-2.1.0-alpha/lapis.lua'
no file '/usr/local/share/lua/5.1/lapis.lua'
no file '/usr/local/share/lua/5.1/lapis/init.lua'
no file '/usr/local/openresty/luajit/share/lua/5.1/lapis.lua'
no file '/usr/local/openresty/luajit/share/lua/5.1/lapis/init.lua'
no file '/usr/local/openresty/lualib/lapis.so'
no file './lapis.so'
no file '/usr/local/lib/lua/5.1/lapis.so'
no file '/usr/local/openresty/luajit/lib/lua/5.1/lapis.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
I took a look around and found that /usr/local/openresty/luajit/include/luajit-2.1/luaconf.h says this:
** Note to distribution maintainers: do NOT patch the following lines!
** Please read ../doc/install.html#distro and pass PREFIX=/usr instead.
#define LUA_LROOT "/usr/local"
The issue can be fixed by adding package.path and package.cpath to nginx.conf, like so:
http {
lua_package_path './?.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua;/usr/lib/lua/5.1/?.lua;/usr/lib/lua/5.1/?/init.lua';
lua_package_cpath './?.so;/usr/lib/lua/5.1/?.so;/usr/lib/lua/5.1/loadall.so';
And that's as far as I've gotten in an hour of bumbling about.
This seems like it could be an openresty package problem, but I'm not sure where exactly the fault lies, let alone where a fix might fit.
Last edited by bdjnk (2014-10-20 06:16:56)
Offline
Manually setting lua_package_path and lua_package_cpath for nginx had unexpected negative consequences. My current work around is simpler.
# ln -s /usr/share/lua /usr/local/share/lua
# ln -s /usr/lib/lua /usr/local/lib/lua
Maybe I should try this on openresty pre install
$ sed -i -e 's/\/local//g' PKGBUILD
I'll do it when I have some time to mess with it.
Offline
This solved the issue. Thanks for that!
Have you tried fixing the pkgbuild?
Offline
I had a similar issue. It was lua5.1 vs lua5.2. I then installed luarocks-5.1 from AUR, and installed lapis via luarocks-5.1.
That fixed it
Offline