Out of the blue I started getting the following error from TextMate’s test runner for Rails tests.
Rails requires RubyGems >= 1.1.1 (you have 1.0.1). Please `gem update --system` and try again.
On the command line, I’d see the following:
jdl ~ $ which gem
/opt/local/bin/gem
jdl ~ $ which ruby
/opt/local/bin/ruby
jdl ~ $ gem -v
1.3.1
jdl ~ $ ruby -v
ruby 1.8.6 (2008-03-03 patchlevel 114) [i686-darwin9.3.0]
Pretty clearly, TextMate was picking up the wrong Ruby installation on my system. With JRuby and at least one other “normal” Ruby installed, it didn’t seem impossible. But why now? I still don’t know the answer to that question, but I did fix the problem.
Digging through the TextMate Ruby bundles, I kept seeing a reference to “TM_RUBY”. In the advanced preferences I set this to have a value of my desired Ruby install, and everything was happy again.

Setting the TextMate TM_RUBY variable in advanced preferences

December 18th, 2009 at 7:06 am
Wow! Bingo!
I couldn’t run tests from textmate and I was getting “Rails requires RubyGems >= 1.3.2 (you have 1.3.1). Please `gem update –system` and try again.” – and I have RubyGems 1.3.5 installed…
I think this was my 5th googling over the last 6 months on this issue and finally a successfull one! Thanks.
December 20th, 2009 at 1:30 pm
You’re welcome. I remember this one stumping me for a while as well.