2

I know other people have had issues installing RVM, but I've looked into their questions/answers and it hasn't helped. I'm using Ubuntu 11.10, and am following the quick install directions here: https://rvm.beginrescueend.com/rvm/install/

Step One works nicely:

    ~$ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
Downloading RVM from wayneeseguin branch stable
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   125  100   125    0     0    909      0 --:--:-- --:--:-- --:--:--  1524
100  799k  100  799k    0     0  1059k      0 --:--:-- --:--:-- --:--:-- 1059k

Upgrading the RVM installation in /home/nsmith/.rvm/
    RVM sourcing line found in: /home/nsmith/.bash_history.

Upgrade Notes:

  * No new notes to display.

# RVM:  Shell scripts enabling management of multiple ruby environments.
# RTFM: https://rvm.beginrescueend.com/
# HELP: http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)
# Screencast: http://screencasts.org/episodes/how-to-use-rvm

# In case of any issues read output of 'rvm requirements' and/or 'rvm notes'

Upgrade of RVM in /home/nsmith/.rvm/ is complete.

# nsmith,
#
#   Thank you for using RVM!
#   I sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne

Lovely. Step 2 also runs fine, with no output. Step 3 returns:

The program 'rvm' is currently not installed.  You can install it by typing:
sudo apt-get install ruby-rvm

From what I've found out, this is probably because I initially tried the first step with sudo, and screwed everything up. I likely screwed things up further by taking the bait and installing with sudo apt-get install ruby-rvm, which is apparently outdated or broken.

Looking for answers led me to:

http://beginrescueend.com/support/troubleshooting/

Where I executed the .sh file outlined under the section "How do I completely clean out all traces of RVM from my system, including for system wide installs?" I also followed the instructions and checked .bashrc, .bash_profiles, .profiles etc for rvm mentions and removed them.

I also tried the answer I found at the StackOverflow question "How can I uninstall Ruby on ubuntu?". Namely, sudo aptitude purge ruby and then, since I didn't actually yet have ruby, sudo aptitude purge ruby-rvm. I've also tried sudo apt-get purge ruby-rvm

Lastly, I've tried the instructions here @mkoby.com entitled "completely-removing-rvm". This basically says remove .rvm* files and run sudo groupdel rvm

I've tried a lot to remove rvm from my system so that I can run a clean install, without sudo, and finally get things going. Does anyone have a suggestion? I'd really appreciate it.

Andy Huber
  • 21
  • 1
  • 2

4 Answers4

7

To fix it once:

$ source ~/.profile
$ rvm

To fix it always, as gotqn said, you can add it at the end of your ~/.bash_profile

$ echo ". .profile" >> ~/.bash_profile
Coren
  • 5,517
  • 1
  • 21
  • 34
  • + 1 But to solve the issue for long, sudo gedit ~/.bash_profile to add source ~/.profile line there. – gotqn Apr 27 '13 at 09:59
4

I am writing this answer as there is no straight forward answer already given that makes rvm work right out of the box without any problems again. Coren's answer is kinda like a temporary solution.

After making a clean install of RVM, just add a single line in your ~/.bash_profile.

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

Create .bash_profile file if one doesn't exist. This instruction is actually a part of the RVM installation manual and we are expected to do this to complete the installation.

I've faced with same problem before and it should work fine thereafter - provided you haven't screwed with shell/bash settings (enough) before.

Also, you may change the $HOME to the location of your home directory if you want to like this: /home/ur_username_here, even then the script should work fine.

After that, just to make sure, close that terminal and open it again.

Test whether RVM is working fine or not by using rvm list or something of that sort. It should work fine.

Bharadwaj Srigiriraju
  • 2,196
  • 4
  • 25
  • 45
3

You have rvm sourcing line in different file.

RVM sourcing line found in: /home/nsmith/.bash_history.

it should either be in .bash_profile or .bashrc file. Make sure these files are automatically loaded

To solve run:

~/.rvm/bin/rvm get head --auto

Also you might need to set some settings especially this might be important: https://rvm.beginrescueend.com/integration/gnome-terminal/

mpapis
  • 52,729
  • 14
  • 121
  • 158
ducktyped
  • 4,354
  • 4
  • 26
  • 38
  • Awesome! This worked for me. It auto removed anything to do with rvm and then re added everything properly, Thanks for the info – jamesc Feb 17 '13 at 15:10
0

I struggled with this also. What it came down to for me was the $PATH variable in the shell.

I followed almost all the same resources you did in trying to get an rvm clean machine. Whenever I would try to run RVM with a non-sudo install, I would get the same message that you get:

"The program 'rvm' is currently not installed.  You can install it by typing:
sudo apt-get install ruby-rvm"

This message is not really an error. It is a script in a file named rvm that says:

echo "The program 'rvm' is currently not installed.  You can install it by typing:
sudo apt-get install ruby-rvm"

I wish I could remember where this file is located, but I can't. (Try the $ which rvm command and confirm that you see an rvm command and that it is just the script mentioned above.) I do know that your current bash $PATH is taking you to this script instead of the location where RVM is really installed. It is the only possible way to get that exact error message.

If you have installed RVM without sudo, it should be in ~/.rvm (a hidden directory inside your home directory.) If your $PATH was set up correctly it would be looking for RVM inside this directory and it would find it. If I remember correctly, I had to move /home/my_name/.rvm/ up to the beginning of my $PATH variable to make it so the rvm command would find rvm there and not find the script file mentioned above.

Hope this helps you out.

Don Leatham
  • 2,694
  • 4
  • 29
  • 41