参考这里
- 点击
Tools->Build System->New Build System
,会新建一个文件,内容如下
{
"shell_cmd": "make"
}
- 以在windows下为例,修改内容为:
{
"cmd": ["D:/Applications/Ruby223-x64/bin/ruby.exe","-w","$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.ruby"
}
其中-w
可选,这里加上是为了在编译和运行的时候,输出warning
信息
- 保存并命名,例如取名为
Truby.sublime-build
- 在
Tools->Build System
中选择Truby
-
Ctrl+B
运行即可