If you are looking for information on how to install Lua, then you have made a great choice. Lua is a great language.
Lua Install on OSX
- We’re using Lua version 5.4.0 because that is the latest stable version right now. If you are using a different version just swap the version that you are using in.
- The profile for the default shell on Mac OSX at the time of this writing is .zshrc.
Download, unpack, and build it:
curl -R -O http://www.lua.org/ftp/lua-5.4.0.tar.gz tar zxf lua-5.4.0.tar.gz cd lua-5.4.0 make all test
Move the directory over to /opt because that is where I like to install things:
cd sudo mv lua-5.4.0 /opt
If you prefer to leave it in your home directory, that’s fine too.
Add this to your path:
That usually means adding an export line to the end of your .zshrc file. This file will be found in your home directory.
You can use whatever editor you like but I use vi like this:
Add a line like this:
In my case I already had a line change the path for something else so I just added the Lua path to that like this:
If you choose to keep LUA in your home directory and not move it to /opt (for example if you don’t have permission on a work or school system) you can just define your path based on your home directory like this:
Open a new terminal to make sure your profile is getting sourced properly. Test running Lua from there.