使用 LuaRocks 管理 Lua 依赖

LuaRocks Lua OpenResty About 2,680 words

列出已安装依赖

luarocks list

查看帮助

luarocks help

查看命令帮助

luarocks help install

查找依赖

luarocks search lua-resty-template

输出

[root@localhost bin]$ ./luarocks search lua-resty-template

lua-resty-template - Search results for Lua 5.1:
================================================


Rockspecs and source rocks:
---------------------------

lua-resty-template
   2.0-1 (rockspec) - https://luarocks.org
   2.0-1 (src) - https://luarocks.org
   1.9-1 (rockspec) - https://luarocks.org
   1.9-1 (src) - https://luarocks.org
   1.8-1 (rockspec) - https://luarocks.org
   1.8-1 (src) - https://luarocks.org
   1.7-1 (rockspec) - https://luarocks.org
   1.7-1 (src) - https://luarocks.org
   1.6-1 (rockspec) - https://luarocks.org
   1.6-1 (src) - https://luarocks.org
   1.5-1 (rockspec) - https://luarocks.org
   1.5-1 (src) - https://luarocks.org
   1.4-1 (rockspec) - https://luarocks.org
   1.4-1 (src) - https://luarocks.org
   1.3-1 (rockspec) - https://luarocks.org
   1.3-1 (src) - https://luarocks.org
   1.2-1 (rockspec) - https://luarocks.org
   1.2-1 (src) - https://luarocks.org
   1.1-1 (rockspec) - https://luarocks.org
   1.1-1 (src) - https://luarocks.org
   1.0-1 (rockspec) - https://luarocks.org
   1.0-1 (src) - https://luarocks.org

安装依赖

默认安装最新版。

luarocks install lua-resty-template

安装指定版本的依赖

luarocks install lua-resty-template 1.9-1

检查新版本

luarocks new_version lua-resty-template

更新最新版本的依赖

自动会移出旧版本。

luarocks install lua-resty-template

更新指定版本的依赖

输出

[root@localhost bin]# ./luarocks install lua-resty-template 1.9-1
Installing https://luarocks.org/lua-resty-template-1.9-1.src.rock

lua-resty-template 1.9-1 depends on lua >= 5.1 (5.1-1 provided by VM)
lua-resty-template 1.9-1 is now installed in /usr/local/openresty/luarocks (license: BSD)

Checking stability of dependencies in the absence of
lua-resty-template 1.8-1...

Removing lua-resty-template 1.8-1...
Removal successful.

查看依赖信息

luarocks show lua-resty-template

输出

[root@localhost bin]# ./luarocks show lua-resty-template

lua-resty-template 1.9-1 - Templating Engine (HTML) for Lua and OpenResty

lua-resty-template is a compiling (HTML) templating engine for Lua and
OpenResty.

License:          BSD
Homepage:         https://github.com/bungle/lua-resty-template
Installed in:     /usr/local/openresty/luarocks

Modules:
    resty.template (/usr/local/openresty/luarocks/share/lua/5.1/resty/template.lua)
    resty.template.html (/usr/local/openresty/luarocks/share/lua/5.1/resty/template/html.lua)
    resty.template.microbenchmark (/usr/local/openresty/luarocks/share/lua/5.1/resty/template/microbenchmark.lua)

Depends on:
    lua >= 5.1 (using 5.1-1)

卸载依赖

移出依赖。

./luarocks remove lua-resty-template
Views: 5,285 · Posted: 2021-05-05

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh