https://github.com/luarocks/luarocks/releases
1.采用luarocks方式安装(优先推荐)
cd /opt/
wget https://luarocks.org/releases/luarocks-2.4.4.tar.gz
tar -zxvf luarocks-2.4.4.tar.gz
cd luarocks-2.4.4/
./configure --prefix="/usr/local/openresty/luajit" --with-lua="/usr/local/openresty/luajit" --lua-suffix=jit --with-lua-include="/usr/local/openresty/luajit/include/luajit-2.1" --with-lua-lib="/usr/local/openresty/luajit/lib/"
make build
make install
ln -s /usr/local/openresty/luajit/bin/luarocks /usr/local/bin/luarocks
luarocks # 测试Luarocks安装
luarocks install luafilesystem # 通过luarocks安装 luafilesystem
resty -e "require 'lfs' " # 测试luafilesystem安装
2: 源码编译安装 https://github.com/keplerproject/luafilesystem/releases
wget https://github.com/keplerproject/luafilesystem/archive/v1_7_0_2.tar.gz
tar -zxvf v1_7_0_2.tar.gz
cd luafilesystem-1_7_0_2
config:
# Default installation prefix
PREFIX=/usr/local/openresty/luajit
make && make install
测试是否安装成功 resty -e "require 'lfs' "
签名:这个人很懒,什么也没有留下!