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.