20

I followed the instructions from the RVM homepage (https://rvm.beginrescueend.com/rvm/install/)

I typed the following:

sudo bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )

the script executed and didn't seem to give any errors.

the same without sudo gave an error:

Warning: Failed to create the file 
Warning: /usr/share/ruby-rvm/archives/wayneeseguin-rvm-stable.tgz: Permission 
Warning: denied
  0  792k    0  3908    0     0   2257      0  0:05:59  0:00:01  0:05:58  2257
curl: (23) Failed writing body (0 != 3908)

Could not download 'https://github.com/wayneeseguin/rvm/tarball/stable'.
  curl returned status '23'.

I also put this in my ~/.bashrc

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

what I get is:

~$ type rvm | head -1
bash: type: rvm: not found

~$ source "/usr/local/rvm/scripts/rvm"
bash: /usr/local/rvm/scripts/rvm: No such file or directory

~$ source "$HOME/.rvm/scripts/rvm"
bash: /home/anonym/.rvm/scripts/rvm: No such file or directory

How can this be fixed?

PS

I'm using Ubuntu 11.10

Andrzej Gis
  • 13,706
  • 14
  • 86
  • 130
  • Did you try reloading your session after changing your .bashrc? To do that, use `source ~/.bashrc` or open new terminal window. – Sergio Tulentsev Dec 23 '11 at 03:53
  • Are you trying to install RVM for your own personal development, or as a system administrator for all users on a shared host? Unless you are a system admin doing it for everyone, you should use the single user installation, per RVM's install page. – the Tin Man Dec 24 '11 at 19:28
  • i got this because i'm behind a proxy. – ftravers Jan 27 '12 at 16:57

8 Answers8

33

Sudo problems. This worked for me to install rvm. Just do:

curl -L https://get.rvm.io | sudo bash -s stable --ruby
hec
  • 569
  • 1
  • 6
  • 12
16
nano ~/.bashrc

at the bottom of the file add these line

unset rvm_path
unset GEM_HOME

Then run

curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install 2.1.3
rvm use 2.1.3 --default
ruby -v
12

Can you try this:

$ curl -s raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer | bash -s stable

or

$ curl -s raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer | sudo bash -s stable

depending on your permissions. That should help. It helped me! :)

Karthick S
  • 3,204
  • 6
  • 36
  • 52
  • In works if you either use it with sudo or if you create a directory with permissions to write first. – Andrzej Gis Dec 26 '11 at 23:37
  • Make sure you've added your user to the rvm group. Also, make sure you log out and log in. Group memberships are processed at login, so in order to write to /usr/local/rvm, you must log out and then log in so that the OS recognizes that you're in the rvm group. – GregB Jan 12 '14 at 20:08
6

I'm sure there's a more elegant way to fix this, but I ran into the same issue and was kinda in a hurry, so I went for a quick and dirty workaround:

$ curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer > foo.sh
$ chmod 755 foo.sh

Then edit line 162, and add -k to the curl command:

$ vim foo.sh
162 if curl -Lk https://github.com/${_repo}/rvm/tarball/${_branch} -o ${rvm_archives_path}/${_repo}-rvm-${_branch}.tgz

Then run the script:

$ ./foo.sh --branch stable

Like I said, not ideal, but it got me where I needed to be quickly.

garrettux
  • 169
  • 4
  • kept digging a little, found this: http://stackoverflow.com/questions/6414232/curl-certificate-error-when-using-rvm-to-install-ruby-1-9-2. In particular, the answer from @dbikard with instructions for updating the cacert bundle for curl. – garrettux Jan 09 '12 at 16:18
  • None of the other solutions worked for me on AWS Centos 5 images. – chaostheory Jan 15 '12 at 10:37
  • this solution "works" for me partially since I had to go inside my foo.sh file and replace https://github.com/ by https://nodeload.github.com/ – Leo May 24 '12 at 00:40
2

If anyone has this problem in the future in ubuntu I was getting this error because of an old package that still had config stuff hanging around.

Try running

sudo apt-get --purge remove ruby-rvm

That should take care of the permission error and let you install RVM as a normal user under $HOME/.rvm

dubvfan87
  • 641
  • 5
  • 18
1

You might have RVM installed under the wrong user. RVM won't let you install if it's installed under another user.

You can uninstall it from the other user with rvm implode.

Log over to the other user and RVM will install correctly!

Joshua Plicque
  • 418
  • 7
  • 10
1

Put this in your .bashrc instead (without echo)

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

And restart your terminal.

Sergio Tulentsev
  • 226,338
  • 43
  • 373
  • 367
0

https://rvm.io/rvm/security#ipv6-issues You can forbid gpg's internal dirmngr from using IPv6 by add the following line to ~/.gnupg/dirmngr.conf:

江洋大盗
  • 181
  • 1
  • 8