Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Lua environment installation


May 12, 2021 Lua


Table of contents


Lua environment installation

Installed on a Linux system

Installing Lua on Linux and Mac is as simple as downloading the source package and unziwing the compilation at the terminal, which is installed in version 5.3.0:

curl -R -O http://www.lua.org/ftp/lua-5.3.0.tar.gz
tar zxf lua-5.3.0.tar.gz
cd lua-5.3.0
make linux test
make install

Installed on the Mac OS X system

curl -R -O http://www.lua.org/ftp/lua-5.3.0.tar.gz
tar zxf lua-5.3.0.tar.gz
cd lua-5.3.0
make macosx test
make install

Next we create a helloworld .lua:

print("Hello World!")

Follow these commands:

$ lua helloWorld

The output is:

Hello World!

Lua is installed on the Window system

Under window you can use an IDE environment called "SciTE" to execute the lua program at the download address:

Once installed, you can write and run Lua programs in that environment.

You can also use LuaDist: You can also use LuaDist: http://luadist.org/


If the installation is wrong: lua.c:80:31: fatal error: readline/readline.h: No such file or directory

Workaround: The libreadline-dev dependency package is missing

centos system: yum install readline-devel
debian system: apt-get install libreadline-dev