I got a White Macbook and I have to go to a conference in 10 hours but I\'m having a lot of problems.
First, I wanted to have Rails 3, so I used MacPorts to install
You should use rvm
as others have said to manage multiple installations of Ruby and Ruby gems. (If you go that way, take the time to read rvm's documentation carefully.)
However, you should also get comfortable figuring out what version of Ruby your shell is seeing as the default and why. It sounds to me like your $PATH
variable may not be properly updated. The $PATH
variable is what determines which Ruby interpreter or gem
command is the first seen, if you have more than one installed (as you now do). MacPorts will install new binaries into /opt/local/bin
by default, and it should also alter your $PATH
so that /opt/local/bin
precedes /usr/bin
(which is where Apple's out of the box Ruby lives).
I suspect that when you did sudo gem install
, you were using /usr/bin/gem
(which is the gem installer for /usr/bin/ruby
rather than /opt/local/bin/gem
(which would be the installer for MacPort's Ruby).
Check the output of echo $PATH
, which ruby
and which gem
to see what's going on.