3.在「終端」輸入 make macosx (回車)
4.在「終端」輸入 make test (回車)
正常狀況下會出現: src/lua -v
Lua 5.3.1 Copyright(C)1994-2015 Lua.org,PUC-Rio
5.而後再輸入「sudo make install」命令,會要求輸入Password: 輸入對應password(你的password)。而後回車就本身主動安裝了
待安裝完畢後可輸入 lua -v,回車就會看到 :Lua 5.3.1 Copyright (C) 1994-2015 Lua.org, PUC-Rio
IDE:
這裏使用sublime text2。google上面大把了
執行腳本:
sublime text2上面選擇:
輸入:
{
"cmd": ["/usr/local/bin/lua", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.lua"
}
保存爲Lua.sublime-build,而後Tools-Build System上就能選擇lua來編譯腳本了(如上圖)
ps:
網上找到的大多數都是
"cmd": ["lua", "$file"]
可能我是用makefile來安裝lua的,需要改一下路徑
lua的編輯和執行環境已經搭建好了
新建一個xxx.lua文件。隨便寫個語句。選擇lua爲build system。按一下花+b,就能跑出來了。
至此,本新手學習lua的環境搭建好了