# luarocks下载 [root@nginx-cluster src]# wget https://github.com/luarocks/luarocks/archive/v3.0.0.tar.gz [root@nginx-cluster src]# tar -zvxf v3.0.0.tar.gz [root@nginx-cluster src]# cd luarocks-3.0.0 # luarocks编译安装 [root@nginx-cluster luarocks-3.0.0]# ./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 --lua-suffix is no longer necessary. The suffix is automatically detected.
Configuring LuaRocks...
Lua version detected: 5.1 Lua interpreter found: /usr/local/openresty/luajit/bin/luajit lua.h found: /usr/local/openresty/luajit/include/luajit-2.1/lua.h unzip found in PATH: /usr/bin
Done configuring.
LuaRocks will be installed at......: /usr/local/openresty/luajit LuaRocks will install rocks at.....: /usr/local/openresty/luajit LuaRocks configuration directory...: /usr/local/openresty/luajit/etc/luarocks Using Lua from.....................: /usr/local/openresty/luajit Lua include directory..............: /usr/local/openresty/luajit/include/luajit-2.1
* Type make and make install: to install to /usr/local/openresty/luajit as usual. * Type make bootstrap: to install LuaRocks into /usr/local/openresty/luajit as a rock.
# 安装luarocks [root@nginx-cluster luarocks-3.0.0]# make build [root@nginx-cluster luarocks-3.0.0]# make install
[root@nginx-cluster lua]# luarocks install dkjson Warning: falling back to curl - install luasec to get native HTTPS support Installing https://luarocks.org/dkjson-2.6-1.src.rock
dkjson 2.6-1 is now installed in /usr/local/openresty/luajit (license: MIT/X11)