1

I am trying to load luasocket lib from openresty, however, I've got very strange error:

2015/01/25 13:06:38 [error] 10065#0: *5 lua entry thread aborted: runtime error: error loading module 'socket.core' from file '/usr/local/lib/lua/5.1/socket/core.so':
    dlopen(/usr/local/lib/lua/5.1/socket/core.so, 6): Symbol not found: _luaL_prepbuffsize
  Referenced from: /usr/local/lib/lua/5.1/socket/core.so
  Expected in: dynamic lookup

stack traceback:
coroutine 0:
    [C]: in function 'require'
    content_by_lua(nginx.conf:20):4: in function <content_by_lua(nginx.conf:20):1>, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost"

luasocket lib was installed using luarocks, which was compiled with those settings:

./configure --prefix=/usr/local/openresty/luajit \
    --with-lua=/usr/local/openresty/luajit/ \
    --lua-suffix=jit-2.1.0-alpha \
    --with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1

I am using lua version 5.1 installed using homebrew:

MacBook-Pro-Fedor-2:bin lobster$ lua5.1
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> 

UPD: thanks for siffiejoe for help. Compile your luarocks with flags --lua-version=5.1 --versioned-rocks-dir and than start luarocks-5.1 instead of luarocks

Lobster
  • 635
  • 2
  • 12
  • 30

0 Answers0