Set the ruby default version with using rvm

117 views
Skip to first unread message

coolesting

unread,
Jul 4, 2011, 11:35:05 AM7/4/11
to Ruby on Rails: Talk
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%)
********************************************************************************

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
documentation:

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

such as,

bash < <(curl -s -B https://rvm.beginrescueend.com/install/rvm)

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
above
mentioned install page as well as the basics page:

https://rvm.beginrescueend.com/rvm/basics/

Enjoy!

~Wayne

********************************************************************************
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.

Hassan Schroeder

unread,
Jul 4, 2011, 4:46:50 PM7/4/11
to rubyonra...@googlegroups.com
On Mon, Jul 4, 2011 at 8:35 AM, coolesting <coole...@gmail.com> 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
install.

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

Robert Campbell

unread,
Jul 4, 2011, 5:32:50 PM7/4/11
to rubyonra...@googlegroups.com
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. 

coolesting

unread,
Jul 5, 2011, 1:04:00 AM7/5/11
to rubyonra...@googlegroups.com
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 ?

2011/7/5 Hassan Schroeder <hassan.s...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


Hassan Schroeder

unread,
Jul 5, 2011, 1:14:32 AM7/5/11
to rubyonra...@googlegroups.com
On Mon, Jul 4, 2011 at 10:04 PM, coolesting <coole...@gmail.com> wrote:

> $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
or
22:09 ~ $ rails -v
Rails 2.3.11

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

coolesting

unread,
Jul 5, 2011, 1:16:58 AM7/5/11
to rubyonra...@googlegroups.com
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




2011/7/5 Hassan Schroeder <hassan.s...@gmail.com>

Chirag Singhal

unread,
Jul 5, 2011, 1:22:02 AM7/5/11
to rubyonra...@googlegroups.com
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.

coolesting

unread,
Jul 5, 2011, 1:57:23 AM7/5/11
to rubyonra...@googlegroups.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.


2011/7/5 Chirag Singhal <chirag....@gmail.com>

Chirag Singhal

unread,
Jul 5, 2011, 2:00:43 AM7/5/11
to rubyonra...@googlegroups.com
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?

coolesting

unread,
Jul 5, 2011, 2:48:41 AM7/5/11
to rubyonra...@googlegroups.com
1.
dengx@dengx-desktop:/$ rvm list

rvm rubies

   ruby-1.9.2-p180 [ i386 ]

dengx@dengx-desktop:/$


2.
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 
 



2011/7/5 Chirag Singhal <chirag....@gmail.com>

Chirag Singhal

unread,
Jul 5, 2011, 3:12:36 AM7/5/11
to rubyonra...@googlegroups.com
Try this:

rvm use ruby-1.9.2
gem install rails

coolesting

unread,
Jul 5, 2011, 7:21:23 AM7/5/11
to rubyonra...@googlegroups.com
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 Campbell <wap...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/MNW05Gl3p9oJ.

coolesting

unread,
Jul 5, 2011, 7:22:56 AM7/5/11
to rubyonra...@googlegroups.com
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

coolesting

unread,
Jul 5, 2011, 7:33:11 AM7/5/11
to rubyonra...@googlegroups.com
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.

2011/7/5 coolesting <coole...@gmail.com>
Reply all
Reply to author
Forward
0 new messages