Using a fresh install of Ruby 1.9.2 (via RVM), Textmate, and the Handcrafted Haml bundle, I get the following error when trying to use it:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:827:in
report_activate_error’: Could not find
RubyGem haml (>= 0) (Gem::LoadError)
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:261:inactivate’
from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:68:in `gem’ from -e:1
I ran sudo gem install haml and it installed successfully. The output of ruby -v is 1.9.2p180. It seems like TextMate is still looking for my system (Mac OS X) version of Ruby, not the new one (1.9.2) I installed. When I look at the gemsets for my RVM-managed Ruby 1.9.2 installation, the Haml gem is loaded. Any thoughts on how to get TextMate to search for the gem in my new/correct gemset?
You need to tell TextMate which Ruby to use. As you guessed and can see from the error, the PATH for TextMate causes it to use
/usr/bin/ruby. See these questions and their answers:I personally use my own non-RVM hand-compiled Ruby in
/usr/local/binand so I go intoTextMate->Preferences->Advanced->Shell Variablesand create a variable named
PATHthat is set to/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbinNote that I’ve put
/usr/local/binbefore/usr/binso that myrubyis found before the system’s.