54

I am trying to install Ruby Version Manager (RVM) without success. How to get through this error I am getting?

ubuntu@ip-172-31-0-20:/tmp$ rvm install ruby-1.9.3-p484
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/14.04/x86_64/ruby-1.9.3-p484.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for ubuntu.
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-1.9.3-p484, this may take a while depending on your cpu(s)...
ruby-1.9.3-p484 - #downloading ruby-1.9.3-p484, this may take a while depending on your connection...
Warning: Failed to create the file ruby-1.9.3-p484.tar.bz2.part: Permission
Warning: denied
  0 9806k    0  1002    0     0  22905      0  0:07:18 --:--:--  0:07:18 23302
curl: (23) Failed writing body (0 != 1002)
There was an error(23).
Checking fallback: http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p484.tar.bz2
Warning: Failed to create the file ruby-1.9.3-p484.tar.bz2.part: Permission
Warning: denied
  0 9806k    0  1167    0     0   4300      0  0:38:55 --:--:--  0:38:55  4290
curl: (23) Failed writing body (0 != 1167)
There was an error(23).
Failed download
There has been an error fetching the ruby interpreter. Halting the installation.
ubuntu@ip-172-31-0-20:/tmp$
Chris
  • 1,416
  • 18
  • 29
Kimda K
  • 563
  • 1
  • 5
  • 8
  • Try going to this website and see if you can download the tar file from there: http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p484.tar.bz2 – ryekayo Oct 07 '14 at 18:28
  • 1
    It looks like it's trying to download the file to a directory you don't have permission to write to. Use the `--debug` flag (i.e. `rvm --debug install ...`) to get more verbose output and update your question. – Jordan Running Oct 07 '14 at 18:33
  • hey man, accept answer. Solution is working properly! – kaleb4eg Jun 18 '15 at 18:38

2 Answers2

150

Your RVM is installed in /usr/local/rvm - it's often called system installation, this requires that your user ubuntu will be added to rvm group:

rvm group add rvm "$USER"

yes use $USER it will be replaced by your shell with your user name

then log out and log in, ensure with:

id

that your user is in rvm group,

finally just in case update permissions for RVM:

rvm fix-permissions
mpapis
  • 52,729
  • 14
  • 121
  • 158
  • Fixed problem for me. Thank you! – Hroft Dec 22 '14 at 11:39
  • 8
    Cheers, though I had to restart the computer not just logout. – Ben Winding Sep 19 '17 at 14:05
  • 3
    You can also run `su - $USER` in order to update your user's rights, without logging out and in again. Then `id` should list you as part of the rvm group – anaotha Apr 09 '19 at 10:40
  • 1
    Hi. I'm using Linux Mint and had the same problem, tryied this solution and didn't work, I had to run `sudo chown -R $USER:rvm /usr/share/rvm/.` BTW, the installation path of rvm is now `/usr/share/rvm` as stated in the Ubuntu installation here: https://github.com/rvm/ubuntu_rvm – eCorners Jan 21 '20 at 13:11
0

The solution by @mpasis might not work if you're installing rvm using ubuntu_rvm as by default because of copy+paste it'll be installed as root. Try installing rvm with without sudo or with curl as explained on rvm.io.

Swaps
  • 1,450
  • 24
  • 31