Daniel Viglione
Daniel Viglione

Reputation: 9407

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

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?

Upvotes: 10

Views: 35862

Answers (10)

sifr_dot_in
sifr_dot_in

Reputation: 3593

Tried all the other answers but this one worked for me:

sudo apt-get install software-properties-common
sudo apt-add-repository -y ppa:rael-gc/rvm
sudo apt-get update
sudo apt-get install rvm

importantly in my case 'rvm' started working after ubuntu restart

Upvotes: 0

jiakai
jiakai

Reputation: 91

just that in latest version To start using RVM you need to run source /etc/profile.d/rvm.sh

This answer solves my problem.

Upvotes: 0

Vijith Vellora
Vijith Vellora

Reputation: 116

Simple Steps:

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

All good.

Upvotes: 9

Alexander Crescent
Alexander Crescent

Reputation: 550

You need to reboot after install rvm.

Come on, reboot is what solves my problem after I have tried all other methods: open new terminal tab, source .bashrc, tried on .bash_profile, etc.

Just reboot, what's it gonna take? It costs you couple minutes maybe?

Do not vote to delete me, this is what solves my problem and it is what I will answer.

export PATH="$PATH:/usr/local/rvm/src/rvm/bin" is certainly one solution, just not a good one, for starter, it clutters your .bashrc file. Just like any problem in computer science. There are always multiple solutions to one problem.

Here is my solution: go through official rvm installation on github, then reboot. And you are done. No file needs to edit manually. It can't be more simpler than that.

Upvotes: 0

smilingfrog
smilingfrog

Reputation: 436

I got this error when running gnome-terminal. Each new bash would have to be reinitialized.

It can be fixed by setting your profile preferences to 'Run command as a login shell', under Edit > Profile Preferences > Command > "Run command as a login shell"

Then logout and in again. If that doesn't work, there is a configuration error elsewhere.

RVM Documentation

Upvotes: 0

asdf
asdf

Reputation: 321

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

Upvotes: 32

Steve Chesnowitz
Steve Chesnowitz

Reputation: 111

Try running

sudo apt-get -f install

Then run the commands found here: https://github.com/rvm/ubuntu_rvm

Upvotes: 0

rocksyne
rocksyne

Reputation: 1372

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.

Upvotes: 6

Mahesh Pawar
Mahesh Pawar

Reputation: 153

Try using:

source ~/.bash_profile

Hope this helps.

Upvotes: 1

Jon Malachowski
Jon Malachowski

Reputation: 256

The main rvm page explains this pretty well. I'd re-read it step by step. Note the difference between single and multi user installs.

https://rvm.io/rvm/install

EDIT: "Multi-User Installs - Using the sudo command

The installation process is similar for both installation methods, however, when installing a multi-user

configuration, do not run the installer directly as/from the 'root' account! A" https://rvm.io/support/troubleshooting#sudo

Upvotes: 0

Related Questions