Solved nginx openresty module 'resty.core.socket' not found:

Hello.
Update ports.
Code:
lua-resty-core-0.1.21
luajit-openresty-2.1.20201027

With this software, everything worked well.
Code:
luajit-openresty-2.1.20201002_1
lua-resty-core-0.1.19
Nginx stopped working.
# /usr/local/etc/rc.d/nginx restart
Code:
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
nginx not running? (check /var/run/nginx.pid).
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.
nginx: [alert] failed to load the 'resty.core' module ([URL]https://github.com/openresty/lua-resty-core);[/URL] ensure you are using an OpenResty release from [URL]https://openresty.org/en/download.html[/URL] (reason: /usr/local/share/lua/5.1/resty/core.lua:22: module 'resty.core.socket' not found:
    no field package.preload['resty.core.socket']
    no file './resty/core/socket.lua'
    no file '/usr/local/share/luajit-2.1.0-beta3/resty/core/socket.lua'
    no file '/usr/local/share/lua/5.1/resty/core/socket.lua'
    no file '/usr/local/share/lua/5.1/resty/core/socket/init.lua'
    no file './resty/core/socket.so'
    no file '/usr/local/lib/lua/5.1/resty/core/socket.so'
    no file '/usr/local/lib/lua/5.1/loadall.so'
    no file './resty.so'
    no file '/usr/local/lib/lua/5.1/resty.so'
    no file '/usr/local/lib/lua/5.1/loadall.so') in /usr/local/etc/nginx/nginx.conf:63
/usr/local/etc/rc.d/nginx: WARNING: failed to start nginx

Install ports
Code:
pkg version | egrep 'lu|nginx'
lua-resty-core-0.1.21              =
lua-resty-lrucache-0.10            =
lua53-5.3.6                        =
luajit-openresty-2.1.20201027      =
nginx-1.18.0_30,2                  =
Please help to work.
 
It seems to be hardcoded for Lua 5.1, not 5.3.

Code:
LUA_MODSHAREDIR=${LOCALBASE}/share/lua/5.1

Did you enable LUA on www/nginx? It's off by default.
Code:
 LUA=off: 3rd party lua module
Code:
LUA_IMPLIES=            DEVEL_KIT
LUA_LIB_DEPENDS=        libluajit-5.1.so:lang/luajit-openresty
LUA_RUN_DEPENDS=        lua-resty-core>0:www/lua-resty-core
LUA_CONFIGURE_ENV=      LUAJIT_INC=${LOCALBASE}/include/luajit-2.1 \
	                        LUAJIT_LIB=${LOCALBASE}/lib
LUA_GH_TUPLE=           openresty:lua-nginx-module:v0.10.19:lua
LUA_VARS=               DSO_EXTMODS+=lua
 
It seems to be hardcoded for Lua 5.1, not 5.3.

Code:
LUA_MODSHAREDIR=${LOCALBASE}/share/lua/5.1

Did you enable LUA on www/nginx? It's off by default.
Code:
LUA=off: 3rd party lua module
Code:
LUA_IMPLIES=            DEVEL_KIT
LUA_LIB_DEPENDS=        libluajit-5.1.so:lang/luajit-openresty
LUA_RUN_DEPENDS=        lua-resty-core>0:www/lua-resty-core
LUA_CONFIGURE_ENV=      LUAJIT_INC=${LOCALBASE}/include/luajit-2.1 \
                            LUAJIT_LIB=${LOCALBASE}/lib
LUA_GH_TUPLE=           openresty:lua-nginx-module:v0.10.19:lua
LUA_VARS=               DSO_EXTMODS+=lua
Who is hardcoded?
I need lua support in nginx.
Yes, I enabled lua in nginx.
What should I do?
 
Back
Top