1. 下载最新版的lua-5.2.0 ( http://www.lua.org/ftp/ )然后解压
  2. 运行“终端”进入到该文件夹下 ,主要是cd 【文件夹名】
  3. 在“终端”输入 make macosx (回车)
  4. 在“终端”输入 make test (回车)MAC 环境下的Lua配置 
    5.输入“sudo make install”命令,会要求输入Password: 输入相应密码(你的密码),然后回车就自动安装了 
    MAC 环境下的Lua配置 
    6.下载sublime text,然后打开,选择tools–>Build system–>New Build system 
    在文件里面输入: 
    输入: 

    “cmd”: [“/usr/local/bin/lua”, “$file”], 
    “file_regex”: “^(…?):([0-9]):?([0-9]*)”, 
    “selector”: “source.lua” 

    保存为Lua.sublime-build,然后Tools-Build System上就能选择lua来编译脚本了 
    7.新建一个文件 
    输入 
    print(“hello yy”) 
    command + b 
    就能看到结果了

相关文章: