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

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

This gem contains only the Ruby libraries for the RVM Ruby API.

In order to install RVM please use one of the methods listed in the

such as,

bash < <(curl -s -B

followed by placing the sourcing line in your ~/.bash_profile or
wherever may
be appropriate for your setup (example, .zshenv, /etc/profile, …):

# Load RVM into a shell session *as a function*
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

After completing setup please open a new shell to use RVM and be
sure to run
‘rvm notes’ to gain a list of dependencies to install before
installing the
first Ruby. You can read more details about this process on the
mentioned install page as well as the basics page:



Successfully installed rvm-1.6.20
1 gem installed
Installing ri documentation for rvm-1.6.20…
Installing RDoc documentation for rvm-1.6.20…

dengx@dengx-desktop:~$ rvm --default use 1.9.2
No command ‘rvm’ found, but there are 20 similar ones
rvm: command not found

thanks all.

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

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

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


$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 ?

2011/7/5 Hassan S. [email protected]

On Mon, Jul 4, 2011 at 8:35 AM, coolesting [email protected] wrote:

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

Hassan S. ------------------------ [email protected]

twitter: @hassan

On Mon, Jul 4, 2011 at 10:04 PM, coolesting [email protected]

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

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

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

depending on which Ruby version and (more particularly) gemset I’ve

Hassan S. ------------------------ [email protected]

twitter: @hassan

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 


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

Rails 3.0.9

2011/7/5 Hassan S. [email protected]

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

2011/7/5 Chirag S. [email protected]

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?


dengx@dengx-desktop:/$ rvm list

rvm rubies

ruby-1.9.2-p180 [ i386 ]


dengx@dengx-desktop:/$ echo $PATH

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

export PATH

2011/7/5 Chirag S. [email protected]

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


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

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

run in the terminal “bash < <(curl -s”

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

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

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

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

What is that mean about above ? a hashed function ?

2011/7/5 Robert C. [email protected]

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

2011/7/5 Chirag S. [email protected]

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
directory “/lib/ruby/gems/ … …”
i did it as that post, but it still not works.

2011/7/5 coolesting [email protected]

Try this:

rvm use ruby-1.9.2
gem install rails