Set the ruby default version with using rvm

Hi, guys,
I successfully installed the rvm but the rvm command is unavailable ,
the installation message as the following :

dengx@dengx-desktop:~$ gem -v
1.8.5

dengx@dengx-desktop:~$ sudo gem install rvm
Fetching: rvm-1.6.20.gem (100%)

I successfully installed the rvm

No, you didn't . Did you even read the message that you pasted into
your email???

rvm: command not found

No kidding. Try following the directions from the output of the gem
install.

After installing rvm, you should close the current terminal window and open a new one. You do not need to install the rvm gem (it is not recommended either.)

I will assume you are using ubuntu. To install rvm, you need to have curl and git installed. (run “sudo apt-get install curl git” if you don’t.)

run in the terminal “bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)”

After it is complete, you can close that terminal window and open a new one.

run in the terminal “type rvm | head -1”

if you see “rvm is a function” then everything went well.

https://rvm.beginrescueend.com/rvm/install/

Thanks, i solved this problem when i submit this post, but i can’t delete it.

But, here, i got another problem, i set the ruby version from 1.9.1 to 1.9.2

and press this command in terminal.
$ruby -v
$ruby 1.9.2

and

$rails -v
now, this result of message of rails shows me my ruby version is 1.9.1

Should i install again for this rails let it update , or do anything ?

Really? On my system, `rails -v` shows me something like

  22:08 ~ $ rails -v
  Rails 3.0.7
or
  22:09 ~ $ rails -v
  Rails 2.3.11

depending on which Ruby version and (more particularly) gemset I've
selected.

That is truth, look my message …

dengx@dengx-desktop:~$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]
dengx@dengx-desktop:~$ rails -v

Rails 3 doesn't officially support Ruby 1.9.1 since recent stable
releases have segfaulted the test suite. Please upgrade to Ruby 1.9.2.

You're running
  ruby 1.9.1p243 (2009-07-16 revision 24175) [i486-linux]

Rails 3.0.9

Most likely the case is that it is picking up the rails version installed on your system ruby.

Try installing rails again on your rvm ruby

Use ‘gem install rails’, if you use ‘sudo’ then it will install to system ruby.

Chirag
http://sumeruonrails.com

dengx@dengx-desktop:~$ gem install rails
Fetching: rails-3.0.9.gem (100%)
ERROR: While executing gem … (Gem::FilePermissionError)
You don’t have write permissions into the /usr/lib/ruby/gems/1.9.1 directory.

Can you paste the output of “rvm list” here?

You have to make sure that you using correct ruby before you install anything. Did you make the changes to your profile (~/.bashrc or ~/.bash_profile) as instructed by rvm?

Chirag
http://sumeruonrails.com

dengx@dengx-desktop:/$ rvm list

rvm rubies

ruby-1.9.2-p180 [ i386 ]

dengx@dengx-desktop:/$

dengx@dengx-desktop:/$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/ruby/bin

the red string is my installation path of ruby,
and i put this lines at the end of the /etc/profile

PATH=$PATH:/usr/local/ruby/bin
export PATH

Try this:

rvm use ruby-1.9.2

gem install rails

Chirag
http://sumeruonrails.com

dengx@dengx-desktop:~$ type rvm | head -1
rvm is hashed (/usr/local/bin/rvm)

What is that mean about above ? a hashed function ?

It will make a error if i using the sudo to install it,
something like this as you said ,

dengx@dengx-desktop:~$ rvm use ruby-1.9.2
Using /usr/local/rvm/gems/ruby-1.9.2-p180

dengx@dengx-desktop:~$ gem install rails
ERROR: While executing gem … (Gem::FilePermissionError)
You don’t have write permissions into the /usr/lib/ruby/gems/1.9.1 directory.

BTY, i want to install it again, and i will get a question.

“The file ‘lib’ not found .” , i googled it and saw a post that says add a directory “/lib/ruby/gems/ … …”
i did it as that post, but it still not works.