7
votes

I've had a difficult time since I started using rvm. I've done all the rvm/textmate set up and have the latest bundles but I still can't run Rspec test from textmate.

  • I have the latest bundle from github.com/rspec/rspec-tmbundle.git and it's installed in ~/Library/Application\ Support/TextMate/Bundles/ RSpec.tmbundle

  • RVM default is using the system ruby 1.8.6

  • Rspec gem versions

    gem list --local | grep spec blue_light_special (0.2.0) rspec (2.2.0) rspec-core (2.2.1, 2.0.1) rspec-expectations (2.2.0, 2.0.1) rspec-mocks (2.2.0, 2.0.1) rspec-rails (2.0.1, 1.3.2)

  • TextMate

    TM_RUBY=/Users/jspooner/.rvm/bin/rvm-auto-ruby

  • The Error: rspec/core (LoadError)

    /Users/jspooner/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/rspec/mate.rb:29:in require': no such file to load -- rspec/core (LoadError) from /Users/jspooner/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/rspec/mate.rb:29 from /tmp/textmate-command-8073.rb:2:inrequire' from /tmp/textmate-command-8073.rb:2

4

4 Answers

6
votes

The best solution I've found is from Jacques Crocker. http://groups.google.com/group/rubyversionmanager/browse_thread/thread/64b84bbcdf49e9b?fwc=1

It requires replacing the contents of textmate_ruby with the code below and never running rvm wrapper xxx textmate again.

#!/usr/bin/env sh 
source ~/.rvm/scripts/rvm 
cd . 
exec ruby "$@" 

This has also fixed the same issue with the cucumber bundle.

1
votes
0
votes

My case is slightly different but took me more than an hour to figure out:

Turns out I ran rvm wrapper ree textmate a while after installing ree with rvm and in the mean time the ree shorthand changed from meaning ree-1.8.7-2010.01 to ree-1.8.7-2010.02

here's more details on my message: https://gist.github.com/721987

I'm posting it here too because it's one of the first pages I landed onto while trying to figure this one out.

0
votes

I've got a similar problem and figured out that my textmate ruby wrapper is pointing to a different version. I was able to get it work by putting below content in projectx/.rvmrc

rvm 1.9.2@projectx --create

rvm wrapper 1.9.2@projectx textmate

Hope this helps.