What went wrong?
During installation, rvm
puts two lines (first one is a comment though) in ~/.bash_profile
file to help bash
recognize ruby binaries. But the problem is Ubuntu's bash
ignores this file. As a result, it doesn't know that you already installed ruby and prompts you to install ruby!
The problem can be solved in two different way.
Solution 1: Using ~/.bashrc
file
Open your ~/.bashrc
file and put these two lines (or last one) there.
### Load RVM into a shell session *as a function*
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
Solution 2: Make the regular shell session as login shell
Or you can turn on your virtual terminal's preference to consider the shell as Login Shell. The settings can be found in -
Gnome Terminal: Menu > Edit > Profile Preference > Command Tab > Run command as a login shell
Mate Terminal: Menu > Edit > Profile Preference > Title & Command Tab > Run command as a login shell
Xfce4 Terminal: Menu > Edit > Preference > General Tab > Run command as login shell
Either one will do the job.
Another solution could be installing Ruby in System using Ubuntu's repository. But that defeats the purpose of using rvm
at first place.