Search code examples
nginxlualuasocketluarocks

lua 5.3 + luasocket 3.0rc1-2: undefined symbol: luaL_setfuncs


I have Luasocket 3.0rc1-2 installed through luarocks with Lua 5.3 running on the server.

When I run a script requiring luasocket on nginx (1.8.0) with LuaJIT (2.1), it produces an error message:

lua entry thread aborted: runtime error: error loading module 'socket.core' from file '/usr/local/lib/lua/5.3/socket/core.so':
    /usr/local/lib/lua/5.3/socket/core.so: undefined symbol: luaL_setfuncs

On the luasocket github page, I see Out of the box support for Lua 5.3.

How can I fix this error?


Solution

  • luajit is not lua 5.3. You cannot mix runtimes.

    You have a version of luasocket built for lua 5.3 but you are running luajit 2.1.