1, first go to the LUA website to download the latest LUA package, http://www.lua.org/download.html
2, the download after the completion of the compression package on the line decompression
3, into the extracted files, such as I was placed in the download folder, in the terminal Input command: CD Downloads, and then enter LS to see what folder Downloads directory, then CD lua-5.3.1 into the Lua folder, the terminal input make MacOSX enter , then enter make test enter, and finally enter the sudo made install, this time will require input password: Enter the corresponding password (your password), and then enter the automatic installation.
4, after the installation is complete we can enter LUA-V to see if the installation is complete, or direct input LUA, if the installation is successful, you can write LUA code in the terminal directly
Install Lua under Mac