Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No command 'rvm' found, but there are 20 similar ones

Tags:

ruby

rvm

I followed the [Phusion Passenger guide][1] to install rvm on EC2. It states to do the following:

$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
$ curl -sSL https://get.rvm.io | sudo bash -s stable
$ sudo usermod -a -G rvm `whoami`
$ if sudo grep -q secure_path /etc/sudoers; then sudo sh -c "echo export rvmsudo_secure_path=1 >> /etc/profile.d/rvm_secure_path.sh" && echo Environment variable installed; fi

I log out and log back in and get the following:

$ rvm
No command 'rvm' found, but there are 20 similar ones
rvm: command not found

I installed rvm as root, which what I wanted. I added my user to the rvm group and so I should have system wide access. The rvm files are still there:

$ sudo find / -name "rvm"
/usr/local/rvm
/usr/local/rvm/src/rvm
/usr/local/rvm/src/rvm/lib/rvm
/usr/local/rvm/src/rvm/bin/rvm
/usr/local/rvm/src/rvm/scripts/rvm
/usr/local/rvm/lib/rvm
/usr/local/rvm/bin/rvm
/usr/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/rvm-1.11.3.9/lib/rvm
/usr/local/rvm/scripts/rvm

Why can't my system find rvm?

like image 310
Daniel Viglione Avatar asked Sep 22 '16 16:09

Daniel Viglione


3 Answers

I solved the problem by the next several steps:

  1. sudo apt-get install curl
  2. curl -L https://get.rvm.io | bash -s stable
  3. source ~/.rvm/scripts/rvm
  4. rvm requirements
like image 155
asdf Avatar answered Oct 14 '22 04:10

asdf


Simple Steps:

1) echo "source /etc/profile.d/rvm.sh" >> ~/.bash_profile
2) . ~/.bash_profile

All good.

like image 29
Vijith Vellora Avatar answered Oct 14 '22 04:10

Vijith Vellora


There is a little trick to this. This is how I solved a similar problem.

Run your terminal command as a login shell. This is how to set that up.

  1. Open your terminal.
  2. At the top menu bar, click on Edit, navigate to Profile Preferences and select the Command tap.
  3. It shoul open a window as shown here in this picture
  4. Select Run command as login shell
  5. Select ok and close.
  6. Close every opened instance of the terminal and restart.

This should fix it. I will be happy to get your feedback if it works for you.

like image 39
rocksyne Avatar answered Oct 14 '22 03:10

rocksyne