Why am I getting "rvm: command not found" on Ubuntu?

53,136

Solution 1

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.

Solution 2

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

Share:
53,136

Related videos on Youtube

Sam
Author by

Sam

studying computer science!

Updated on September 18, 2022

Comments

  • Sam
    Sam over 1 year

    I am trying to set up Siri Proxy, and I come up to the steps:

    rvmsudo rvm install 1.9.3
    rvm use 1.9.3 --default
    rvmsudo gem install eventmachine CFPropertyList httparty json uuidtools
    

    But I can't do them due to these errors:

    rvm: command not found
    rvmsudo: command not found
    

    I know this is due to Ruby Version Manager not being installed or properly set up. I am using Ubuntu 11.04 and I only have SSH access.

    This is what I've done beforehand to install and initialize Ruby:

    sudo apt-get install nano ruby build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
    bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
    [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
    echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile