开发者

How Do I Install Lua on MacOS?

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 oth开发者_如何转开发er then (xcode , titanium , corona) so easy on me please :)

I tried this link but it does not work.

Also Is there a fully guided 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.


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


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. :)


If you have brew installed, just try:

brew install 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.


With MacPorts:

sudo port install lua


If you have brew, use the following code:

brew update
brew install lua

That works for me.


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.


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


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"


The download url show below. http://www.lua.org/download.html

lua-5.3.1.tar.gz 2015-06-10, 276K

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜