如何在MacOS上安装Lua?
我刚刚从官方网站下载了Lua。
我想在我的 Mac 上安装它,但我不知道如何安装。我从来没有尝试过使用 Mac 来安装和使用除(xcode、titanium、corona)以外的编译器,所以请对我轻松一点:)
我尝试过 此链接 但它不起作用。
还有关于如何在 mac 上安装和开始使用 Lua 的完整指南吗?因为我看到的都是 Windows :S
注意:在我问这个问题之前,我在 SOV 上搜索过,但找不到答案。
I just downloaded Lua from the official website.
I want to install it on my Mac but I have no clue how. And I've never tried using Mac to install and use compilers other than (xcode, titanium, corona) so go easy on me please :)
I tried this link but it does not work.
Also is there a full guide on how to install and start using Lua on mac? Because all I see is windows :S
note: Before I asked this question I searched on SOV but I could not find my answer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
这个 Wiki 几乎没有列出:
http://lua-users.org/wiki/MacOsxLua
如果您使用 Homebrew (https://brew.sh/),只需输入:
This Wiki has few listing:
http://lua-users.org/wiki/MacOsxLua
If you use Homebrew (https://brew.sh/), just type:
从源代码编译并不是那么痛苦。
Lua 5.1.4在这里:http://www.lua.org/ftp/lua-5.1。 4.tar.gz
Lua 5.2 alpha 在这里: http://www.lua.org/work/lua-5.2 .0-alpha.tar.gz
以 Lua 5.2 为例:
之后,你可以在当前目录下看到'lua'二进制文件。
现在你可以输入lua来尝试一下。 :)
Compiling from source code is not that painful.
Lua 5.1.4 here: http://www.lua.org/ftp/lua-5.1.4.tar.gz
Lua 5.2 alpha here: http://www.lua.org/work/lua-5.2.0-alpha.tar.gz
Take Lua 5.2 as example:
After that, you can see 'lua' binary under current dir.
Now you can enter lua to have a try. :)
如果您安装了
brew
,只需尝试:brew install lua
If you have
brew
installed, just try:brew install lua
您只需按照 http://www.lua.org/start.html 上的指南操作即可:
启动你的终端并输入:
你甚至可以将最后两个步骤结合起来
,之后我可以在我的终端中输入
,然后应该出现类似: 的内容
。这说明lua已经正确安装了。
You just follow this guide on http://www.lua.org/start.html:
Fire up your terminal and type in:
You can even combine the last two steps to
After that I could just type in
into my terminal and something like:
should appear. This means that lua is installed correctly.
对于 MacPorts:
With MacPorts:
如果您有
brew
,请使用以下代码:这对我有用。
If you have
brew
, use the following code:That works for me.
mac上使用源码编译
Compile using source on mac
我只是按照般若的答案去http://www.lua.org/versions。 html#5.3 下载 lua-5.3.6.tar.gz
然后使用终端:
之后,您可以在当前目录下看到'lua'二进制文件。
执行后:
即可运行lua
I have just follow the Prajna's answer and go to http://www.lua.org/versions.html#5.3 to download the lua-5.3.6.tar.gz
And then use the terminal:
After that, you can see 'lua' binary under current dir.
After execute:
You can run the lua
你不“安装”它。它应该只是一个二进制文件,可以从您将其提取到的任何位置运行。
如果您找不到二进制文件(Lua 站点上的某个位置应该有一个链接),那么只需按照说明从源代码构建它即可。
啊,这里是二进制文件:http://luabinaries.sourceforge.net/download.html
可能需要标有“MacOS X Intel Executables”的文件
You don't "install" it. It should just be a binary that runs from wherever you extract it to.
If you can't find a binary (there should be one linked somewhere on the Lua site) then just follow the instructions to build it from source.
Ah, here are the binaries: http://luabinaries.sourceforge.net/download.html
You'll probably want the file labelled "MacOS X Intel Executables"
下载地址如下所示。
http://www.lua.org/download.html
lua-5.3.1.tar。广州
2015-06-10, 276K
The download url show below.
http://www.lua.org/download.html
lua-5.3.1.tar.gz
2015-06-10, 276K