Closed lee3164 closed 4 years ago
lua_package_path 设置问题
https://pgl.yoyo.org/luai/i/package.loaders
For each template, the searcher will change each interrogation mark in the template by filename, which is the module name with each dot replaced by a "directory separator" (such as "/" in Unix); then it will try to open the resulting file name. So, for instance, if the Lua path is the string
"./?.lua;./?.lc;/usr/local/?/init.lua"
the search for a Lua file for module foo will try to open the files ./foo.lua, ./foo.lc, and /usr/local/foo/init.lua, in that order.
我按照 demo进行操作,报这样的错误 2019/12/18 15:28:09 [error] 55676#12685090: init_by_lua error: init_by_lua:4: attempt to call field 'init' (a nil value) stack traceback: init_by_lua:4: in main chunk
下面是 配置文件片段
下面是我的 package.path![image](https://user-images.githubusercontent.com/8246969/71065281-eac31880-21ab-11ea-8597-09aad4e2ebc4.png)
下面是我的package的位置![image](https://user-images.githubusercontent.com/8246969/71065181-ac2d5e00-21ab-11ea-804c-6bfb7ccffad0.png)
我是通过
opm get upyun/lua-resty-checkups
来安装的 可以看出 这个库是位于 package.path里面的,但是 为啥会报错啊?