9、安装并使用lua-package包 luarocks install lua-package 接下来我们写一段代码测试下lua-package可用性,如下所示: location /test { content_by_lua_block {localpackage=require("lua-package")localpackageObj =package:new('zhang','wei') ngx.say(packageObj:get_fullname()) } } 启动这段代码,并访问...
1 Luarocks can't install a library 1 How to install luagraph using luarocks 2 Install resources with code in luarocks 3 Luarocks: Creating a rock from package with multiple files 8 How can I install lua rocks from a manifest file? 1 luarocks install local source...
这个命令还可以通过追加参数--pack-binary-rock而仅仅编译生成 rock 文件,make 命令与 install 命令的区别在于 install 基于 rock文件,而 make 必须基于 rockspec 文件。 ➥pack ~/Desktop/t-luarocks/ luarocks help pack NAME /usr/local/bin/luarocks pack - Create a rock, packing sources or binar...
$ find ./local/-type d -name"cmark"./local/share/lua/5.1/cmark./local/lib/luarocks/rocks/cmark 通过定义 package.path 变量指向本地 rocks 目录,可以在 Lua 代码中使用该库: package.path = package.path .. ';local/share/lua/5.3/?.lua'require("cmark") 获取已安装rock的信息 你可以通过显...
export PATH=$PATH:/usr/local/openresty/luajit/bin) 1. 执行luarocks install package就可以安装lua的包了 luarocks install package --tree=path还可以指定你安装的包的存放路径 更多命令大家可以直接使用luarocks help 来查看,或者看下另一个博友的整理的比较详细的命令说明...
luarocks install --tree=rocks luasocket luarocks install --tree=rocks lualogging 代码package.path = package.path .. ";./rocks/share/lua/5.4/?.lua" require("logging") if #arg > 0 then if arg[1] ~= nil and arg[1] == "on" then local dbg = require("emmy_core") dbg.tcpListen...
./configure--prefix=/usr/local/luarocks-2.2.2--with-lua=/usr/local/lua-5.1.5make build make install 安装完成后,直接运行luarocks即可使用。 // luarocksLuaRocks2.2.2,amoduledeployment systemforLuaNAME/usr/local/bin/luarocks-LuaRocksmain command-lineinterface ...
RUN/usr/local/openresty/luajit/bin/luarocksinstalllua-rocks-app-project## 按照包 调用代码 localuserslogin=require("users.login") localjson=require("cjson") functionlogininfo(name,pass) localname,pass=userslogin(name,pass) localloginresult= { ...
LuaRocks 3.8.0, the Lua package manager 1. /usr/local/bin/luarocks - LuaRocks main command-line interface 1. Options: 1. -h, --help Show this help message and exit. 1. --version Show version info and exit. 1. --dev Enable the sub-repositories in rocks servers for ...
./configure --prefix=/usr/local/luarocks-2.2.2--with-lua=/usr/local/lua-5.1.5makebuildmakeinstall 安装完成后,直接运行luarocks即可使用。 // luarocksLuaRocks2.2.2,amodule deploymentsystemforLua NAME /usr/local/bin/luarocks - LuaRocks maincommand-lineinterface ...