I installed RVM using the following command

\curl -L https://get.rvm.io | bash -s stable

Then I restarted the terminal and executed this commands

source ~/.rvm/scripts/rvm
rvm requirements
rvm install ruby
rvm use ruby --default

If I run this commands when I start the terminal I get ruby 2.1.2 as the default ruby version, but if I restart the terminal and I run

ruby -v

I get the following message

The program 'ruby' can be found in the following packages:
 * ruby
 * ruby1.8
Try: sudo apt-get install <selected package>

Can you check if your ~/.profile or ~/.bashrc have been modified by the RVM installer? They should, but there could have been something wrong with the installation (and honestly, I find RVM's instructions and installation procedure very confusing.)

If you want RVM to always be loaded on shell startup, you should put its initialization commands into your shell's configuration file. For Bash under Ubuntu (or any Linux), that'd be ~/.bashrc. On other operating systems, such as OS X, you'd rather put it in ~/.bash_profile.

You could try adding the commands by calling the following, mentioned in this blog post:

cd ~
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> .bashrc

Then, restart your shell, and RVM should be sourced.

| improve this answer | |

I followed original posters steps and verified my .bashrc and .bash_profile.

You need to make sure your running bash shell as a /bin/bash --login.

Usually there is a setting to run all commands as login. My rvm had all the correct information in the .bashrc and .bash_profile, but I was still seeing version 1.8 ruby.

After editing the terminal profile and restarting terminal, my version of ruby showed up as latest.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.