Not sure if you ever solved this. But it sounds like 1 of 2 problems:
1. You installed the wrong ruby with MacPorts
if you just ran port install ruby
, then you installed the old version, which explains why ruby -v
still shows 1.8.6.
If you ran port install ruby19
, then you installed ruby 1.9, but under the name ruby19. To access it, you'd have to type ruby19
in place of ruby
...so ruby19 script/generate
, ruby19 -v
...etc.
To fix that you can do port install ruby19+nosuffix
2. you still have your PATH set to the old Ruby, which is why you're getting 1.8.6 on ruby -v
.
First you gotta figure out where OSX is looking for your ruby by typing which ruby
. If you're using MacPorts, that command should return /opt/local/bin/ruby
. If which ruby
returns /usr/bin/ruby
, then it's still finding the default ruby that comes with OSX, which is 1.8.6.
To change your PATH, go open up .bash_profile, located in your user folder (if you have textmate, you can do mate
~/.bash_profile). Add in this line and save:
echo PATH="/opt/local/bin:/opt/bin:$PATH"
Basically you add the MacPorts ruby into your PATH, so the system looks for ruby in the /opt
folder too. Also, maybe more importantly, you put the MacPorts path in front of the default PATH, so it will find that one first.
Goodluck with that. Personally though, I vote for Homebrew. You can find my setup for that at my blog.