Execute Ruby Code in Sublime Text 2

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.

How to run a Ruby script in Sublime Text 2 from project root

A build file like this might meet your requirements:

{
"working_dir": "/full/path/to/project/root/",
"cmd": ["/full/path/to/ruby/", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.ruby"
}

How to build ruby code in Sublime text 2?

It didn't work because system's language was Russian.

RubyTest in Sublime Text 2

To get this to work you only need to change one setting in the RubyTest package in sb2.

If you are using rvm, your rspec gem is installed through rvm and is not found in /bin/sh

So you need to set the RubyTest package for Sublime Text 2 to automatically check for your rvm environment variables.

What to change:

1) In Sublime Text 2, go to Preferences|Browse Packages. This will open up your packages directory.

2) Open the 'RubyTest' directory and look for the file 'RubyTest.sublime-settings'.

3) find the line that says:

"check_for_rvm": false,

and change it to:

"check_for_rvm": true,

save the change.

4) That's it. It should now work.

Good Luck

Sublime running Ruby code can't open a spreadsheet

Check the output of running puts Dir.pwd from Sublime and pwd from the command line. Probably you are operating on different directories. You may also try specifying an absolute path.



Related Topics



Leave a reply



Submit