Openresty和luasocket错误

时间:2015-01-25 10:45:18

标签: nginx lua luasocket

我正在尝试从openresty加载luasocket lib,但是,我有一个非常奇怪的错误:

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使用luarocks安装,使用这些设置进行编译:

./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

我使用的是使用自制软件安装的lua 5.1版:

MacBook-Pro-Fedor-2:bin lobster$ lua5.1
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> 
UPD:感谢siffiejoe的帮助。使用标志--lua-version = 5.1 --versioned-rocks-dir编译你的luarocks,而不是启动luarocks-5.1而不是luarocks

0 个答案:

没有答案