Lua 安装

Lua 安装

Lua 安装

MacOS安装

1
brew install lua53

或者 源码编译

1
2
3
4
5
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

Linux

1
2
3
4
5
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

测试是否安装成功

1
2
 ~ lua -v
Lua 5.3.5 Copyright (C) 1994-2018 Lua.org, PUC-Rio

执行文件

创建一个 HelloWorld.lua 文件,代码如下:

1
print("Hello World!")

执行

1
2
lua HelloWorld.lua
》Hello World!


 
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×