views:

117

answers:

1

I made a change to my shell profile and now when I try to run the Rails console on a Rails app I created, I get this message:

Loading development environment (Rails 2.3.4)
Rails requires RubyGems >= 1.3.2 (you have 1.0.1). Please `gem update --system` and try again.

However, when I run gem -v the output is 1.3.5. What happened here, and how do I fix it? I already renamed the gems version (along with Ruby 1.8.6 and Rails 1.2.6) that came with Leopard to "gem.orig". I added a debug to the Rails initializer and for some reason require 'rubygems' is loading v1.0.1 and not the installed version? How do I fix this? It happened all of a sudden when I changed my shell and configuration.

+1  A: 

You probably need to re-set RUBYOPT for the new shell. Details are in the Gems documentation.

Azeem.Butt
That didn't seem to work - I added export RUBYOPT=rubygems to my .zshrc file, but I still get that "version 1.0.1" message.
Wayne M
I also noticed that doing Gem::RubyGemsVersion from an irb console says the version is 1.0.1 so maybe that has something to do with it? I don't know where it's finding that version since gem -v correctly reports v1.3.5
Wayne M
Did you install another version of Ruby somewhere with a package management system whose binaries might no longer be in your search paths?
Azeem.Butt
The only thing I did was rename the version of Ruby that came with OSX (along with RubyGems and Rails) since for some reason it forgot that I installed newer version (it was working fine until I decided to switch Shells)
Wayne M
I even tried reinstalling RubyGems, but after updating I get the same output (needs version 1.3.2 or greater, you have version 1.0.1
Wayne M
The weird thing is that I can create a new Rails app without any problems. It's just when I try to run the server or console that I get that error back.
Wayne M
So you renamed the symlink in /usr/bin or you renamed the binaries themselves? Either way, I think you've probably trashed more than you realize with your customization attempts and should probably just reinstall if you want to get back up and running in a reasonable amount of time. Either that or switch to Passenger and Ruby Enterprise.
Azeem.Butt