I spent many hours struggling with this same problem! I could not get rspec to run within Sublime Text 2, using the Michael Hartl "Ruby on Rails Tutorial." It kept saying:
/bin/sh: rspec: command not found
I finally realized that the RubyTest package (
[To see links please register here]
) was looking in the WRONG PLACE for my RVM!
On my Mac, the path for RubyTest is `/Library/Application Support/Sublime Text 2/Packages/Ruby Test`
First, to make RubyTest seek the RVM, I changed the parameter in RubyTest.sublime-settings from
"check_for_rvm": false, to "check_for_rvm": true,
Then I dug into the Python code of run_ruby_test.py:
[To see links please register here]
At line 151, inside class BaseRubyTask, it had the wrong path for my RVM:
rvm_cmd = os.path.expanduser('~/.rvm/bin/rvm-auto-ruby')
I changed it to the full correct path: `rvm_cmd = os.path.expanduser('/usr/local/rvm/bin/rvm-auto-ruby')`
If this is not your path, find the correct path by typing
`$ which rvm-auto-ruby` and substitute that instead.
After saving run_ruby_test.py, I went to Terminal, cd to my Rails application directory, and ran `spork`
Finally, I opened static_pages_spec.rb in Sublime Text 2. Now all the tests work from it!