如何在MacOS上安装Lua?

发布于 2024-10-28 23:22:19 字数 343 浏览 2 评论 0原文

我刚刚从官方网站下载了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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

悸初 2024-11-04 23:22:19

这个 Wiki 几乎没有列出:
http://lua-users.org/wiki/MacOsxLua

如果您使用 Homebrew (https://brew.sh/),只需输入:

brew update
brew install lua

This Wiki has few listing:
http://lua-users.org/wiki/MacOsxLua

If you use Homebrew (https://brew.sh/), just type:

brew update
brew install lua
陌伤浅笑 2024-11-04 23:22:19

从源代码编译并不是那么痛苦。

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 为例:

  1. 打开 Terminal.app
  2. wget http://www.lua.org/work/lua-5.3.0-work3.tar.gz
  3. tar xvzf lua-5.3.0-work3.tar.gz
  4. cd lua-5.3.0 -work3/src
  5. make macosx(我相信你已经安装了Xcode)

之后,你可以在当前目录下看到'lua'二进制文件。

sudo cp lua /usr/bin/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:

  1. Open your Terminal.app
  2. wget http://www.lua.org/work/lua-5.3.0-work3.tar.gz
  3. tar xvzf lua-5.3.0-work3.tar.gz
  4. cd lua-5.3.0-work3/src
  5. make macosx(I believe you have Xcode installed)

After that, you can see 'lua' binary under current dir.

sudo cp lua /usr/bin/lua

Now you can enter lua to have a try. :)

帅哥哥的热头脑 2024-11-04 23:22:19

如果您安装了 brew,只需尝试:

brew install lua

If you have brew installed, just try:

brew install lua

一腔孤↑勇 2024-11-04 23:22:19

您只需按照 http://www.lua.org/start.html 上的指南操作即可:

启动你的终端并输入:

curl -R -O http://www.lua.org/ftp/lua-5.3.5.tar.gz
tar zxf lua-5.3.5.tar.gz
cd lua-5.3.5
make macosx test
make install

你甚至可以将最后两个步骤结合起来

make macosx install

,之后我可以在我的终端中输入

lua

,然后应该出现类似: 的内容

Lua 5.3.5  Copyright (C) 1994-2018 Lua.org, PUC-Rio

。这说明lua已经正确安装了。

You just follow this guide on http://www.lua.org/start.html:

Fire up your terminal and type in:

curl -R -O http://www.lua.org/ftp/lua-5.3.5.tar.gz
tar zxf lua-5.3.5.tar.gz
cd lua-5.3.5
make macosx test
make install

You can even combine the last two steps to

make macosx install

After that I could just type in

lua

into my terminal and something like:

Lua 5.3.5  Copyright (C) 1994-2018 Lua.org, PUC-Rio

should appear. This means that lua is installed correctly.

吻风 2024-11-04 23:22:19

对于 MacPorts

sudo port install lua

With MacPorts:

sudo port install lua
初见终念 2024-11-04 23:22:19

如果您有 brew,请使用以下代码:

brew update
brew install lua

这对我有用。

If you have brew, use the following code:

brew update
brew install lua

That works for me.

世界如花海般美丽 2024-11-04 23:22:19

mac上使用源码编译

tar -zxvf lua-x.x.x.tar.gz 
cd lua-x.x.x
make macosx
cd src
sudo cp lua /usr/bin/

Type lua and you should get the prompt.

Compile using source on mac

tar -zxvf lua-x.x.x.tar.gz 
cd lua-x.x.x
make macosx
cd src
sudo cp lua /usr/bin/

Type lua and you should get the prompt.
递刀给你 2024-11-04 23:22:19

我只是按照般若的答案去http://www.lua.org/versions。 html#5.3 下载 lua-5.3.6.tar.gz

然后使用终端:

$cd lua-5.3.6/src

$make macosx

之后,您可以在当前目录下看到'lua'二进制文件。

执行后:

$sudo cp lua /usr/bin/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:

$cd lua-5.3.6/src

$make macosx

After that, you can see 'lua' binary under current dir.

After execute:

$sudo cp lua /usr/bin/lua

You can run the lua

喜爱纠缠 2024-11-04 23:22:19

你不“安装”它。它应该只是一个二进制文件,可以从您将其提取到的任何位置运行。

如果您找不到二进制文件(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"

对岸观火 2024-11-04 23:22:19

下载地址如下所示。
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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文