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
How to Loop Over a Hash of Hashes
Why Bundle Install Is Installing Gems in Vendor/Bundle
How to Specify a Required Switch (Not Argument) with Ruby Optionparser
Ruby: Character to Ascii from a String
Rspec: How to Stub an Instance Method Called by Constructor
What's the Difference Between "Includes" and "Preload" in an Activerecord Query
Change the Context/Binding Inside a Block in Ruby
When to Use Curly Braces VS Parenthesis in Expect Rspec Method
How to Display a PDF in Ror (Ruby)
Ruby Dropped in Netbeans 7,How to Use It in Netbeans7
What Is the Best/How to Validate an Email Address in Ruby
How to Make a Ruby String Safe for a Filesystem
Skip Over Iteration in Enumerable#Collect