天天看點

MAC 環境下的Lua配置

  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

    就能看到結果了

繼續閱讀