Out of the box, rspec.tmbundle doesn't always interact smoothly with TextMate and RVM. Here's how to fix a few errors TextMate may generate:
/Users/your-username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- spec/autorun (LoadError) from /Users/your-username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /Users/your-username/Library/Application Support/TextMate/Bundles/rspec.tmbundle/Support/lib/rspec/mate.rb:43:in `rescue in ' from /Users/your-username/Library/Application Support/TextMate/Bundles/rspec.tmbundle/Support/lib/rspec/mate.rb:40:in `' from :29:in `require' from :29:in `require' from /tmp/textmate-command-12490.rb:2:in `'
rspec.tmbundle
TextMate's rspec bundle is looking for a rspec-tm file in the project root directory, specifying which version of Rspec to be using. --rspec-version 2.9.0
, for instance.
RVM
RVM needs rvm-auto-ruby
, a project .rvmrc, or a wrapper. Set the .rvmrc to something like rvm use 1.9.3@this-projects-gemset
, for instance. (MiniTest is fine with me just using rvm-auto-ruby, while Rspec is also needing the .rvmrc for some reason. So if you're still getting errors, try combining solutions.)
rspec.tmbundle may also need you to set RUBYOPT to "rubygems".