OSX自制软件Lua51找不到lua命令

时间:2017-05-04 18:33:59

标签: lua homebrew

当我用brew安装lua51时,它无法运行命令。但是,当我安装lua(默认情况下自制安装lua 5.2)时,lua命令可以正常工作。

我尝试了brew链接,但显示lua51已经链接。

这是一份成绩单

$ brew install lua                                                                                        (master) 
Updating Homebrew...
....... Install output .......
  /usr/local/Cellar/lua/5.2.4_4: 144 files, 705.5KB
$ lua                                                                                                     (master) 
Lua 5.2.4  Copyright (C) 1994-2015 Lua.org, PUC-Rio
> 
$ brew uninstall lua                                                                                      (master) 
Uninstalling /usr/local/Cellar/lua/5.2.4_4... (144 files, 705.5KB)
$ lua                                                                                                     (master) 
zsh: command not found: lua
$ brew install lua51                                                                                      (master) 
==> Downloading https://homebrew.bintray.com/bottles/lua@5.1-5.1.5_4.el_capitan.bottle.tar.gz
....... Install output .......
  /usr/local/Cellar/lua@5.1/5.1.5_4: 136 files, 702.2KB
$ lua                                                                                                     (master) 
zsh: command not found: lua

1 个答案:

答案 0 :(得分:4)

我下载了https://homebrew.bintray.com/bottles/lua@5.1-5.1.5_4.el_capitan.bottle.tar.gz并看到它包含

./5.1.5_4/bin/lua-5.1
./5.1.5_4/bin/lua5.1 -> lua-5.1

因此,您需要运行lua-5.1lua5.1,而不是lua