7

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

jspooner
  • 10,975
  • 11
  • 58
  • 81

4 Answers4

6

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.

jspooner
  • 10,975
  • 11
  • 58
  • 81
1

Did you try following the instructions here: http://rvm.io/integration/textmate/

mpapis
  • 52,729
  • 14
  • 121
  • 158
Aaron Gibralter
  • 4,773
  • 3
  • 35
  • 50
  • 1
    Okay I found the problem with those directions. In text it says to set TM_RUBY to /Users/wayne/.rvm/bin/textmate_ruby and in the image (http://cl.ly/23Yl) it shows it set to rvm-auto-ruby. textmate_ruby works and the rvm-auto-ruby doesn't work. – jspooner Nov 30 '10 at 19:45
  • @jspooner, how about sending a note to Wayne Seguin, who wrote and maintains RVM, and let him know about the error. Do `rvm -v` for his email address. Good catch! – the Tin Man Dec 01 '10 at 04:48
0

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.

ilpoldo
  • 506
  • 6
  • 7
0

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.

Guoliang Cao
  • 507
  • 4
  • 11