I am getting rvm: command not found after installation of rvm
Asked Answered
R

7

12

I know the above question is very common question. I have gone through multiple posts on this topic. But I didn't get any resolution.

I have installed rvm locally. We already have the installation files. SO went into the folder and run the install command.

$ ./install 

Then I checked ./rvm folder in the Users home folde

$ cd ~/.rvm 

folder exists. Hence Installation is successful.

Now I am typing rvm in the command line

$ rvm

I am getting below exception

$ rvm
-sh: rvm: command not found

After reading the multiple articles in stackoverflow on this issue, I learned that I have to add the below lines in .bash_profile as I am using Mac OSX 10.7.3

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

Even after I am getting same exception while typing rvm. Is there any thing extra I need to do? or Am I missing some thing? Please help

Recessive answered 6/11, 2012 at 7:34 Comment(0)
B
24

Steps to try out:

  1. Log out and login to your system.

  2. Open a new terminal and manually run

source $HOME/.rvm/scripts/rvm

then

rvm

Check these work-arounds.

Update:

To avoid running

source $HOME/.rvm/scripts/rvm

every time you open a terminal, include this line into ~/.MacOSX/environment in your Mac (This is similar to ~/.bashrc in GNU/Linux-based systems under $home aka ~ directory).

Bureaucratize answered 6/11, 2012 at 7:40 Comment(6)
I have tried with the above specified steps. How ever I am getting "-bash: $HOME/.rvm/scripts/rvm: No such file or directory" while running the command "$ source '$HOME/.rvm/scripts/rvm'". And after that if I run rvm in terminal still I am getting the specified exception. Please helpRecessive
@Ramesh please post your rvm installation directory path.Bureaucratize
@Ramesh irrespective of the installation path, if your rvm was installed correctly, then run source path_to_rvm_directory/scripts/rvm. It should run the script rvm and then type the command rvm.Bureaucratize
It is working. Thank you. Earlier I have run with quotes source '$HOME/.rvm/scripts/rvm'. Now I have run with out quotes. ThanksRecessive
Thanks for your on time support. Really appreciatedRecessive
For me, it was source /usr/share/rvm/scripts/rvm that worked.Circumambulate
A
9

In my case, i am using Ubuntu Bash in Windows 10 and to fix the problem i used:

source /usr/local/rvm/scripts/rvm
Axel answered 4/1, 2017 at 16:11 Comment(2)
Solved my problem.Forever
This solved my problem when setting up RVM in DockerScever
C
5

For those that are doing this in 2018 just add

source $HOME/.rvm/scripts/rvm 

to your .bash_profile within your home directory.

Constituent answered 10/1, 2018 at 4:21 Comment(0)
S
2

you need to enable login shell in terminal emulator preferences, sometimes it is needed to use /usr/bin/bash --login, here is an example https://rvm.io/integration/gnome-terminal/

after enabling login shell you need to close terminal application and open it fresh.

Sawicki answered 6/11, 2012 at 16:46 Comment(1)
This is the solution for an entirely different issue where the rvm command is found but the user will receive the error RVM is not a function. It is also not sometimes but either-or. The user should either change the terminal preferences and reopen the terminal or issue bash --login in which case terminal reopen is not needed but it is a 1-time solution only.Xanthous
G
2

I just had to open a new Terminal session.

After I installed it using:

curl -sSL https://get.rvm.io | bash -s stable --ruby
rvm install 2.2
Gentlemanfarmer answered 3/9, 2016 at 16:32 Comment(0)
N
2

For Ubuntu 18.04, I had to run the command below to solve the issue after rvm was installed using instruction from here.

source /usr/share/rvm/scripts/rvm
Nerveless answered 18/7, 2019 at 10:56 Comment(0)
J
0

This is one of other options available for RVM:

source /etc/profile.d/rvm.sh
Jenn answered 26/7, 2020 at 13:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.