views:

71

answers:

4

So I think I have a bunch of rubies scattered around here. I want to install rails 3 and watch the railscast online and the person uses rvm to manage ruby versions. I went to install rvm and followed the instruction. I got to the point where I need to do

rvm install 1.9.2

EDIT: and I did

rvm 1.9.2

However after the installation, I try

ruby -v

and get

ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]

I also go and do

which ruby

and get

/usr/bin/ruby

How do I set up my path so that I can use the ruby that is installed using rvm?

inside /Users/denniss/.rvm/bin I have the ruby-1.9.2-rc2

and my .profile looks like

export PATH="$PATH:/Applications/android/tools"
export PATH="$PATH:/Applications/rubystack/apache2/bin"
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
export PATH="/Users/denniss/.rvm/bin/:/usr/bin:/usr/local/bin:$PATH"
A: 

You have to switch to the new version with rvm 1.9.2. This is only temporary, however. To permanently set it, you can pass the --default: rvm --default 1.9.2.

kyl
+1  A: 

Type:

rvm list

That'll display all the versions of ruby you have.

Then type :

rvm use 1.9.2

And everytime you open you're terminal it will default to your original ruby. To change this type :

rvm --default 1.9.2

Note: You don't need to use RVM to use Rails3. I recommend keeping the ruby v you have, and just installed rails 3 for the new app. Rails 2 and Rails 3 will not overwrite each other.

Trip
I did that and I saw that ruby 1.9.2 is the only one listed. I have edited my post and I already did rvm 1.9.2 and still the ruby -v returns me the one located in /usr/bin/ruby
denniss
Try copying and pasting exactly what ruby version it is for example "ruby-1.9.2-head" or "ruby-1.9.1-p378" and make the full bash statement say `$> rvm use ruby-1.9.1-p378" or whatever your actual version is.
Trip
And you have to type the word `use` ! don't forget that part or it won't work. So it has to be `rvm use 1.9.2` :D
Trip
A: 

Actually, I forgot to add the

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

at the very end of my ~/.profile

denniss
A: 

Correct, if RVM is not loading the used ruby into the environment then you are most likely not sourcing it in your profiles.

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

This is in both the installer output and the documentation for installation:

http://rvm.beginrescueend.com/rvm/install/

~Wayne

Wayne E. Seguin