Lua Environment
# Lua Environment Installation
## Installation on Linux System
Installing Lua on Linux & Mac is very simple. You just need to download the source package, extract, compile, and install it in the terminal. This tutorial uses version 5.4.7 for installation:
### Source Code Installation
Download and install from source:
curl -L -R -O https://www.lua.org/ftp/lua-5.4.7.tar.gz tar zxf lua-5.4.7.tar.gz cd lua-5.4.7 make all test make install
### Installation Using Package Manager
For Debian/Ubuntu systems:
sudo apt update sudo apt install lua5.3
For CentOS/RHEL systems:
sudo yum install epel-release sudo yum install lua
* * *
## Installation on Mac OS X System
### Source Code Installation
Download and install from source:
curl -L -R -O https://www.lua.org/ftp/lua-5.4.7.tar.gz tar zxf lua-5.4.7.tar.gz cd lua-5.4.7 make all test make install
### Homebrew
Install using Homebrew:
brew install lua
### Testing
Next, we create a HelloWorld.lua file with the following code:
print("Hello World!")
Execute the following command:
$ lua HelloWorld.lua
The output will be:
Hello World!
* * *
## Installing Lua on Windows System
On Windows, you can use an IDE environment called "SciTE" to execute Lua programs. The download address is:
* Github download address: [https://github.com/rjpcomputing/luaforwindows/releases](https://github.com/rjpcomputing/luaforwindows/releases)
!(#)
* Google Code download address: [https://code.google.com/p/luaforwindows/downloads/list](https://code.google.com/p/luaforwindows/downloads/list)
After double-clicking to install, you can write and run Lua programs in this environment.
YouTip