Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Do I Install Lua on MacOS?

Tags:

macos

lua

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

like image 696
Mohammad Fadin Avatar asked Mar 31 '11 06:03

Mohammad Fadin


2 Answers

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 
like image 103
jemeshsu Avatar answered Oct 09 '22 22:10

jemeshsu


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

like image 26
Prajna Avatar answered Oct 09 '22 22:10

Prajna