简体   繁体   English

如何在sublime-text-2中运行ruby文件

[英]How to run ruby files in sublime-text-2

When i press ctrl+b to run simple code such as: 当我按ctrl + b运行简单的代码,如:

puts "asdasd"

the result is blank field. 结果是空白字段。 Ruby path is /home/yukke/.rvm/rubies/default/bin/ruby and ruby -v => ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]. Ruby路径是/home/yukke/.rvm/rubies/default/bin/ruby和ruby -v => ruby​​ 1.9.3p194(2012-04-20 revision 35410)[x86_64-linux]。

so I tried to change Ruby.sublime-build to 所以我试着改变Ruby.sublime-build

{
    "cmd": ["/home/yukke/.rvm/rubies/default/bin/ruby", "-u","$file"],
    "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
    "selector": "source.ruby"
}

But it didn't change anything. 但它没有改变任何东西。 Please help me to fix this problem. 请帮我解决这个问题。

试试这个,取出“-u”,并使用rvm

"cmd": ["/home/yukke/.rvm/bin/rvm-auto-ruby", "$file"]

You need to save the file before it will work. 您需要先保存文件才能生效。 It's not nearly as nice as TextMate's Command R , and doesn't work in the same way, if that was what you were expecting. 它不像TextMate的Command R那么好,并且不能以相同的方式工作,如果这是你期望的那样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM