Execute Ruby code in sublime text 2 Execute Ruby code in sublime text 2 ruby ruby

Execute Ruby code in sublime text 2


I didn't save the file. That's why it didn't work. To run a file without saving it first (like TextMate) you should try to use the Anypreter plugin.


I'm using windows here, but make sure you have selected the correct build system: "Tools > Build System > Ruby", then just press CTRL+B


For future reference, hope it helps somebody:

I came here with the same problem. (In Sublime Text 3)I followed the answers:

  • selected ruby extention (bottom right in window)
  • selected in menubar: Tools > Build System > Ruby
  • save the file with a name
  • pressed command + b

and still saw:

[Finished in 0.1s]

In the end the (stuppid) problem was:the console window was only one line big. So I only saw the last line, which is the note:

[Finished in 0.1s]

solution: make the console window bigger et voila.I couldn't find any setting for that. So in the end I did that with the mouseScreenshot Sublime Text 3 - cropped

note the cursor (and ruby extention)