2

When i press ctrl+b to run simple code such as:

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].

so I tried to change Ruby.sublime-build to

{
    "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.

Баста
  • 136
  • 1
  • 9
Alexander Karmes
  • 2,438
  • 1
  • 28
  • 34
  • The "build" feature can only display up to 4 errors. It isn't meant to display full input. – Robert K Aug 07 '12 at 18:19
  • possible duplicate of [Execute Ruby code in sublime text 2](http://stackoverflow.com/questions/11410158/execute-ruby-code-in-sublime-text-2) – Robert K Aug 07 '12 at 18:20
  • Make sure ruby is in the PATH (for windows) of your operating system. By default Submlime has a Ruby build system and it works out of the box. You need to fix in the operating system path, it appears that sublime could not find the ruby executable. – 18bytes Aug 08 '12 at 05:56
  • Robert K, of course i saved the file. Sundar, my OS is ubuntu. Yesterday i reinstall ubuntu, rwm, ruby and sublime. But it still don't works.. – Alexander Karmes Aug 08 '12 at 10:23

2 Answers2

7

Try this, take out the "-u", and use rvm

"cmd": ["/home/yukke/.rvm/bin/rvm-auto-ruby", "$file"]
Баста
  • 136
  • 1
  • 9
1

You need to save the file before it will work. It's not nearly as nice as TextMate's CommandR, and doesn't work in the same way, if that was what you were expecting.

iconoclast
  • 21,213
  • 15
  • 102
  • 138