LuaRocks 是lua模块管理工具,官方网站:https://luarocks.org/
安装
Unix 系统安装
$ wget https://luarocks.org/releases/luarocks-3.3.1.tar.gz
$ tar zxpf luarocks-3.3.1.tar.gz
$ cd luarocks-3.3.1
$ ./configure && make && sudo make install
$ sudo luarocks install luasocket
$ lua
Lua 5.3.5 Copyright (C) 1994-2018 Lua.org, PUC-Rio
> require "socket"
mac os 安装方式
$ brew install luarocks
==> Downloading https://mirrors.aliyun.com/homebrew/homebrew-bottles/bottles/luarocks-3.4.0.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Pouring luarocks-3.4.0.catalina.bottle.tar.gz
==> Caveats
LuaRocks supports multiple versions of Lua. By default it is configured
to use Lua5.3, but you can require it to use another version at runtime
with the `--lua-dir` flag, like this:
luarocks --lua-dir=/usr/local/opt/lua@5.1 install say
==> Summary
🍺 /usr/local/Cellar/luarocks/3.4.0: 104 files, 704.5KB