rvm command not found

49,115

Solution 1

Possible duplicate of: Ubuntu rvm setup issue


Your problem is that RVM is not loaded when you open a new terminal.

To solve this, run this command line: (if using login-shell)

echo "source $HOME/.rvm/scripts/rvm" >> ~/.bash_profile

Or this (if using non-login shell):

echo "source $HOME/.rvm/scripts/rvm" >> ~/.bashrc

Or if you are using zsh (and/or oh-my-zsh):

echo "source $HOME/.rvm/scripts/rvm" >> ~/.zshrc

This will add the path to RVM to load at each Terminal instantiation. You must either close and reopen your terminals or simply call source ~/.bashrc (or ~/.bash_profile or ~/.zshrc).

Solution 2

I had this problem after installing zsh. I'm a domain user so my $PATH and $HOME are not as straight-forward. What worked for me was

echo "source /usr/share/rvm/scripts/rvm" >> ~/.zshrc

Share:
49,115
Hell0
Author by

Hell0

Yes, i'm

Updated on July 10, 2022

Comments

  • Hell0
    Hell0 almost 2 years

    I installed rvm with rails, from the official website of RVM, I specified the command suggested by the tutorial. When the installation my system has rails 4.0.0, rvm 01/23/12, ruby 2.0.0, bundler gem 1.3.5 and 2.0.3 But I need to install ruby 1.9 to practice with a course that I am currently doing. "Rails for Zombies 2" I try to execute the instruction rvm install 1.9.3 and the console returns this message: rvm: command not found

  • Hell0
    Hell0 over 10 years
    thank you very much for the quick response. Sorry to say that the problem has not been solved, but thanks. We'll see. I've opened bash_profile file to verify that it has written the line, and effectively written. After I closed and re-open the terminal. When I write rvm-v terminal returns the version o f me but if I write rvm install 1.9.3 the same mistake again
  • Hell0
    Hell0 over 10 years
    when I include the line you suggest, the terminal returns me the following error: -bash: / home / <user> / .rvm / scripts / rvm: No such file or directory
  • remo
    remo about 10 years
    Just make sure that you don't have "sh" as your default shell because rvm won't load on such a simple shells without warning
  • sunil
    sunil almost 6 years
    added source ~/.bash_profile then it works for me after above command to update on system
  • Alex
    Alex over 2 years
    If you followed the official instructions to install rvm, you can also add source "/etc/profile.d/rvm.sh" to your bashrc.
  • Almokhtar
    Almokhtar about 2 years
    great answer it works thanks