views:

44

answers:

2

I seem to have gotten myself turned around while trying to install Rails 3 and haven't been able to figure out what I'm doing wrong. Prior to trying to upgrade I was on 2.3.2 Here's what I have thus far...

$ which ruby

/usr/local/bin/ruby

$ ruby -v

ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9.8.0]

$ which rails

/usr/bin/rails

$ rails -v

Rails 3 requires Ruby 1.8.7 or 1.9.2. You're running ruby 1.8.6 (2009-06-08)
Please upgrade to continue.

I tried installing rvm by pasting the following into the Terminal

bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

After receiving the welcome message I wanted to verify that it was installed but entering

type rvm | head -n1

returned

-bash: type: rvm: not found

Any ideas what I'm doing wrong and/or how I can go about moving forward? Thanks in advance for any insight...

BTW - I'm Mac OSX 10.5.8 and

+1  A: 

I'm wondering, did you install ruby originally with macports or some other package manager? I think by default ruby should be installed at /usr/bin/ruby. If I was you I'd just go delete /usr/local/bin/ruby and and compile and install from source.

Go pick up 1.9.2 (which is out of beta) here: http://www.ruby-lang.org/en/downloads/

and make and install it, then check your PATH vars and see if the path is in there.

I find just starting clean slate to be the easiest, I also feel like RVM makes things a little overly complex.

Joseph Silvashy
Prior to trying to upgrade, I think it was installed at /usr/bin/ruby but I was following http://hivelogic.com/articles/ruby-rails-leopard I added export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH" to my profile. I've since removed it but perhaps the path is still local?
Shawn
+2  A: 

The reason you got that error saying -bash: type: rvm: not found is because once installing the rvm for the first time, you need to add this line of code to your ~/.bash_profile:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"  # This loads RVM into a shell session.

Restart the terminal, and now when you type type rvm | head -n1 it will work.

agentbanks217
That was spot on! I didn't realize/understand that it needed to be added to .bash_profile, I had added it to .profile.
Shawn
Ya I have made that same mistake too. On Mac OSX, the terminal loads from the ~/.bash_profile and does not even call the ~/.profile at all (by default). But anyways, I'm glad you were able to get it working.
agentbanks217
Ok yah, I didn't even think about that, nice call. As much as I like the concept of RVM, it's implementation seems a bit messy to me, it is however super convenient.
Joseph Silvashy