0

When I do ruby -v I get:

ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] 

which ruby returns:

/usr/bin/ruby 

rvm list returns:

rvm rubies =* ruby-2.1.0 [ x86_64 ] ruby-2.1.2 [ x86_64 ] # => - current # =* - current && default # * - default 

When I change the current and default Ruby version to 2.1.0. then ruby -v returns:

ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux] 

And which ruby shows:

/home/akhil/.rvm/rubies/ruby-2.1.0/bin/ruby 

But in a new terminal ruby -v again shows:

ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] 

I don't want to change the default Ruby version every time.

cat ~/.bash_profile returns

[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* 
5
  • Dont know how to check content of ~/.bash_profile Commented Sep 16, 2014 at 19:43
  • You check the content of ~/.bash_profile by looking at it. Use cat ~/.bash_profile. Alternatives to cat are less, more, view. Read through the RVM installation page carefully, and follow their debugging steps. Commented Sep 16, 2014 at 19:48
  • Thanks for that. cat ~/.bash_profile returns [[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session as a function Commented Sep 16, 2014 at 19:53
  • Which installation method did you use? Single- or multi-user? Commented Sep 16, 2014 at 20:30
  • I dont know that. I am new in rails. Commented Sep 17, 2014 at 19:03

1 Answer 1

1

I'm not sure what command you're using to change the ruby version in rvm, you didn't specify. My hunch is you're using rvm use, this is only temporary for the shell session. To change it permanently use rvm default:

rvm --default use ruby-2.1.0 

This change will persist to new shell sessions.

Sign up to request clarification or add additional context in comments.

1 Comment

I tried it but it does change the ruby version only for current terminal and doesnot set it as defalut. Default system ruby-1.9.3 is present in /usr/bin/ruby folder.And ruby-2.1.0 is present in /home/akhil/.rvm/rubies/ruby-2.1.0/bin/ruby folder. Should I remove /usr/bin/ruby folder? Please help!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.