preload
Feb 22

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

Setting the TextMate TM_RUBY variable in advanced preferences

2 Responses to “TextMate test runner and “Rails requires RubyGems” error”

  1. Mirko Says:

    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.

  2. jdl Says:

    You’re welcome. I remember this one stumping me for a while as well.

Leave a Reply