官术网_书友最值得收藏!

Installing Lua on macOS

Follow these steps to install Lua 5.2.4 on macOS. These instructions are written for macOS High Sierra, but the steps are the same on previous (and future) versions of macOS as well:

  1. To download Lua 5.2.4, visit https://sourceforge.net/projects/luabinaries/files/5.2.4/.
  2. Click on the Tools and Executables link.
  3. Click on the lua-4.2.4_MacOS1011_bin.tar.gz link to start downloading Lua.

 

  1. Once the zip file has downloaded, unzip it. The archive should contain two files, lua52 and luac52:
  1. Create a new folder in your ~/Documents directory, and name this folder LUA. Move both lua52 and luac52 into this new directory:

  1. Rename lua52 to just lua.
  2. Launch a Terminal window. The Terminal app is located at /Applications/Utilities/Terminal.app. You can also simply type Terminal into the universal search on macOS.

 

  1. With the new Terminal window open, type sudo nano /etc/paths and hit Enter. You will be asked for your password; this is the password for your user account. The password will not show up as you type it. After the password is entered, nano will open; nano is a Terminal-based text editor. You should see something similar to the following window:
  1. You can navigate the type cursor with the arrow keys. Don't worry if your paths file (the file we are editing) already has text in it. We will be adding a new entry into this file; where in the file you add the new entry does not matter. On a new line, type ~Documents/LUA:
  1. Press Ctrl + X to exit nano. The program will ask you if you want to save the changes you have made to the file. Press Y to save changes.
  2. Nano will ask you to confirm the filename. Just hit Enter to accept the default path.

 

  1. In order for the changes made in the paths to take effect, you must restart the Terminal app. To do this, right-click on the Terminal icon in your macOS dock and select Quit. Then, launch a new Terminal window.
  2. In the new Terminal window, type lua -v. If everything is set up correctly, the Terminal should print out the installed version of Lua (5.2.4):
主站蜘蛛池模板: 金寨县| 东城区| 锡林郭勒盟| 平阳县| 新乡县| 墨玉县| 南丰县| 望城县| 贵州省| 石泉县| 静乐县| 溧阳市| 普兰店市| 崇明县| 鸡西市| 白山市| 鸡泽县| 温泉县| 寻甸| 交城县| 阜平县| 阳泉市| 南木林县| 镇巴县| 阿拉尔市| 淅川县| 喀什市| 阿坝县| 芜湖市| 阳谷县| 棋牌| 阳西县| 怀柔区| 韶山市| 潼南县| 祁东县| 陈巴尔虎旗| 青河县| 瑞安市| 始兴县| 建水县|