orangelib
orange 0.7 的第三方包
$ opm get zhangbao0325/orangelib
orangelib
orange 0.7 的第三方包
使用说明
1. git clone orange 项目后,执行命令:
cd orange
opm --install-dir=./ get zhangbao0325/orangelib
2. 当前目录下会生成一份 lualib 文件目录,里面是所有 orange 0.7 版本所依赖的 lua 包。3. 修改 conf/nginx.conf 文件的 lua_package_path 如下:
#----------------------------Orange configuration-----------------------------
lua_package_path './lualib/?.lua;./lualib/resty/?.lua;../?.lua;/usr/local/lor/?.lua;;';
4. orange 还依赖于 luafilesystem 和 luasocket 包,推荐使用 luarocks 安装。
可能出现的问题
opm 和 luarocks 安装过程中可能遇到的报错: 1. Can't locate Digest/MD5.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /home/openresty/bin/opm line 16. BEGIN failed--compilation aborted at /home/openresty/bin/opm line 16. 解决方法:
yum -y install perl perl-devel
yum -y install perl-Digest-MD5
2. /usr/bin/luarocks install luafilesystem Installing https://luarocks.org/luafilesystem-1.7.0-2.src.rock... Using https://luarocks.org/luafilesystem-1.7.0-2.src.rock... switching to 'build' mode gcc -O2 -fPIC -I/usr/include -c src/lfs.c -o src/lfs.o src/lfs.c:66:17: fatal error: lua.h: No such file or directory #include <lua.h> ^ compilation terminated.
错误:构建错误:编译对象 src/lfs.o 失败 解决方法:
# 删除原有的luarocks工具
# rpm -e luarocks --nodeps
执行find命令找到lua.h的路径:
# find / -name "lua.h"
/home/openresty/luajit/include/luajit-2.1/lua.h
源码安装luarocks
下载luarocks源码包,解压后安装
./configure --prefix=/usr/local/luarocks --with-lua-include=/home/openresty/luajit/include/luajit-2.1
make && make install
再执行luarocks install luafilesystem
作者
zhangbao0325
许可证
mit
版本
-
zhangbao0325/orangelib 1.0.4orange 0.7 的第三方包 2019-07-23 02:34:57
-
zhangbao0325/orangelib 1.0.2orange 0.7 的第三方包 2019-07-18 18:49:55
-
zhangbao0325/orangelib v1.0.1orange v0.7 的第三方包 2019-07-16 13:17:12
-
zhangbao0325/orangelib 1.0.0orange v0.7 的第三方包 2019-06-02 12:40:21