开发者社区 > 云原生 > 中间件 > 正文

咨询一个问题, 升级到trengine3.0.0 版本 后 lua 报错, nginx: [err

咨询一个问题, 升级到trengine3.0.0 版本 后 lua 报错,
nginx: [error] lua_load_resty_core failed to load the resty.core module from https://github.com/openresty/lua-resty-core; ensure you are using an OpenResty release from OpenResty - Download (rc: 2, reason: module 'resty.core' not found:
no field package.preload['resty.core']
no file './resty/core.lua'
no file '/usr/local/share/luajit-2.1.0-beta3/resty/core.lua'
no file '/usr/local/share/lua/5.1/resty/core.lua'
no file '/usr/local/share/lua/5.1/resty/core/init.lua'
no file './resty/core.so'
no file '/usr/local/lib/lua/5.1/resty/core.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')

展开
收起
云上静思 2023-10-16 12:52:26 202 0
2 条回答
写回答
取消 提交回答
  • 可以参考tengine-ingress的dockerfile: https://github.com/alibaba/tengine-ingress/blob/master/images/tengine/rootfs/Dockerfile

    也可以参看 tengine CI/CD https://github.com/alibaba/tengine/blob/master/.github/workflows/test-nginx-core.yml

    此答案来自钉钉群“Tengine 开源交流群”

    2023-10-16 20:17:27
    赞同 展开评论 打赏
  • 月移花影,暗香浮动

    你遇到的问题是 LuaJIT 或 Lua 无法找到 resty.core 模块,这是因为你可能没有正确安装或配置 OpenResty,或者你正在使用的 OpenResty 版本并不包含 resty.core。

    1、确认你的 OpenResty 版本:确保你使用的是最新版的 OpenResty,并且这个版本应该包含 resty.core。你可以在 OpenResty 的官方文档或发布说明中查看具体版本信息。
    2、重新安装或更新 OpenResty:如果你发现你的 OpenResty 版本过低或者不包含 resty.core,你应该尝试重新安装或更新到最新版。具体的安装或更新步骤可以在 OpenResty 的官方文档中找到。
    3、检查你的环境变量:确保你的环境变量正确地指向了 Lua 和 OpenResty 的安装位置。例如,LUA_PATH 和 LUA_CPATH 应该包含 Lua 和 OpenResty 的库路径。
    4、检查你的代码:如果你已经确认了上述所有的步骤,那么问题可能出在你的代码上。确保你的代码没有错误地导入了 resty.core 或者在其他地方造成了 resty.core 的加载失败。

    2023-10-16 15:54:29
    赞同 展开评论 打赏

为企业提供高效、稳定、易扩展的中间件产品。

相关电子书

更多
《Nginx 代理系统常用手册》 立即下载
CentOS Nginx PHP JAVA 多语言镜像使用手 立即下载
CentOS Nginx PHP JAVA多语言镜像使用手册 立即下载