10

I have executed the commands as prescribed in the instructions at the rvm website but things don't seem to work..

Fetching the code from the git repository runs smoothly but when I try to use

 rvm notes

Error:

/usr/local/bin/rvm: line 73: /home/cody/.rvm/scripts/rvm: No such file or directory

flashes in multiple lines and doesn't stop till I hit ctrl+C.. I am running Ubuntu 8.04 and currently I am running ruby 1.9.2.. Sorry, if I am missing out any necessary information. Thanks in advance.

4
  • If I had to guess, I'd say you installed rvm using sudo or as root. If that is the case, remove it and reinstall without sudo. It works perfectly fine installed for the local user. Feb 9, 2011 at 13:47
  • According to your snippets, it looks to have installed into /usr/local. Look in there for a directory called "rvm" or ".rvm" and delete it. You also need to delete /usr/local/bin/rvm. Feb 9, 2011 at 13:59
  • There are four more files... rvm-auto-ruby, rvm-prompt, rvm-shell and rvmsudo, should I delete them too?? Feb 9, 2011 at 14:06
  • Yes, anything referencing rvm. Feb 9, 2011 at 14:16

8 Answers 8

35

Ack, I didn't mean to post this as a comment on the question. Anyway, if I had to guess, I'd say you installed rvm using sudo or as root. If that is the case, remove it and reinstall without sudo:

sudo rm -rf $HOME/.rvm $HOME/.rvmrc /etc/rvmrc /etc/profile.d/rvm.sh \
  /usr/local/rvm /usr/local/bin/rvm
sudo /usr/sbin/groupdel rvm # this might fail, it's not that important

Open new terminal window/tab and make sure rvm is removed:

env | grep rvm

The output should be empty, sometimes it's needed to relogin, after it's empty you can continue:

curl -sSL https://get.rvm.io | bash -s stable

It works perfectly fine installed for the local user.

2
  • Delete /usr/local/bin/rvm and find where the rvm install directory is and delete it too. It looks like it should also be under /usr/local somewhere. Try "find /usr/local -name rvm". Feb 9, 2011 at 14:03
  • Had a similar issue but was due to installing default gem file with sudo. changing the user from root fixed for me.
    – djburdick
    Mar 17, 2011 at 20:44
3

Ok, for anyone who tried to install RVM using sudo and is now pulling their hair out trying to get it to install in $HOME/.rvm, here's what did it for me:

When you installed RVM using sudo, it created a file /etc/rvmrc, which contains the following:

umask g+w  
export rvm_path="/usr/local/rvm"  

This makes all future attempts at installation (even when not run as sudo) install into /usr/local/rvm, which is NOT what you want for a single user installation. So remove /etc/rvmrc and then you can run

bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)  

and it will install properly into $HOME/.rvm

0
3

DId you add this line to your ~/.bashrc?

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
0
2

I have executed the commands as prescribed in the instructions at the rvm website.

WHICH commands? There are several pages containing instructions to install RVM depending on whether you want a single-user "sandbox" or are installing system-wide for a multi-user system as the administrator.

Because you have RVM in /usr/local, I think you tried to do a system-wide install but didn't get it right. For 99% of us, that is the wrong installation method, and instead you should use the single-user installation, which is simple and puts everything in ~/.rvm.

Either way, be sure to read the entire instructions. And, if doing a single-user install, finish the install with the "Post Install" modifications to ~/.bashrc or ~/.bash_profile for a single-user, then start a new terminal session.

When using the single-user install NEVER use sudo to install gems to a RVM-managed Ruby, even though the instructions for a gem might say to.

0

Look at the section "Troubleshooting your install" here. Since you are on Ubuntu, you probably need to make further mods to you .bashrc

0

in .bashrc have you changed the

[ -z "$PS1" ] && return

to

if [[ -n "$PS1" ]]; then

and added this to the end of the file:

fi

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

0

I just had a similar problem.

It turned out that many files in ~/.rvm/scripts/ and ~/.rvm/src/rvm/scripts/ which obviously should be executable did not have execute permissions. Running a script on both directories to set all files to executable solved that immediate problem.

0

I have got same problem after installation. Then I restarted terminal and it started working poperly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.