7

macOS 上安装 Lua 及 Luarocks

 2 years ago
source link: https://blog.triplez.cn/posts/install-lua-and-luarocks-in-macos/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

macOS 上安装 Lua 及 Luarocks

December 13, 2020 · 1 分钟 · TripleZ

在 macOS 上安装多版本 Lua 及 Luarocks。

Homebrew#

Lua、LuaJIT 和 Luarocks 都可以直接通过 brew 包管理直接安装,而且可以处理不同版本的 Luarocks,使用的仓库为 mesca/homebrew-luarocks

$ brew tap mesca/luarocks

Lua 5.1, 5.3 都需要在 Homebrew 中添加 mesca/luarocks 仓库。

Lua 5.1#

# Lua 5.1
$ brew install lua51
$ brew install luarocks51

使用方式:

# 进入 Lua 5.1 REPL
$ lua5.1
# 使用 Lua 5.1 的 Luarocks
$ luarocks-5.1 --version

LuaJIT#

# LuaJIT
$ brew install luajit
$ brew install luarocks51 --with-luajit

使用方式:

# 进入 LuaJIT REPL
$ luajit
# LuaJIT 与 Lua 5.1 共用 Luarocks
$ luarocks-5.1 --version

Lua 5.3#

# Lua 5.3
$ brew install lua53
$ brew install luarocks53

使用方式:

# 进入 Lua 5.3 REPL
$ lua5.3
# 使用 Lua 5.3 的 Luarocks
$ luarocks-5.3 --version

Lua 5.4 (Current)#

# Current: 5.4
$ brew install lua
$ brew install luarocks

使用方式:

# 进入 Lua 5.4 REPL
$ lua
# 使用 Lua 5.4 的 Luarocks
$ luarocks --version

Build from Source#

请参照 Luarocks 官方安装指南 。或者 OpenResty 文档中关于 Luarocks 的内容


知识共享许可协议
本作品采用知识共享署名-相同方式共享 4.0 国际许可协议进行许可。

« 上一页
发布你第一个 Luarocks 包
下一页 »
macOS 使用笔记


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK