Why am I getting "rvm: command not found" on Ubuntu?
The problem is that the commands rvm
and rvmsudo
are not in your PATH
. The PATH
is a variable that lists all of the directories that are searched for commands.
You need to find out where the rvm
and rvmsudo
commands are actually located; it could be in /usr/local
somewhere or in /opt
. If the RVM software was installed in /usr/local
I would guess that it would work just fine; check /opt
.
Then add the directories that contain commands to your PATH
(on the command line and in .profile
):
export PATH=$PATH:/opt/rvm/bin:/opt/rvm/sbin
(The directories are just examples.) Using $PATH
preserves your current PATH and adds the two new directories on the end. Directories are searched from left to right and are separated by :
.
More on this can be found in man bash
or man sh
or man ksh
depending on your shell.
On Ubuntu you need to use ~/.bashrc instead of ~/.bash_profile in case if per user installations, So do:
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bashrc
or if you're using ubuntu 12.04:
echo '[[ -s "/usr/local/rvm/scripts/rvm" ]] && . "/usr/local/rvm/scripts/rvm" # Load RVM function' >> ~/.bashrc
and after that:
source ~/.bashrc
and test with:
type rvm | head -1
you should get: rvm is a function