running into issues with RVM during Ruby install (1.9.2)
Asked Answered
F

5

4

I'm trying to install ruby via RVM and am getting the following error and the logs are not really clear as to what's going on, has anyone run into this? I seem to recall that Ruby should not be installed as root but I'm a bit suspicious of the permissions error that I'm getting.

**Installing Ruby from source to: /Users/mark/.rvm/rubies/ruby-1.9.2-p290, this may take a while depending on your cpu(s)...
ruby-1.9.2-p290 - #fetching 
ruby-1.9.2-p290 - #downloading ruby-1.9.2-p290, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Warning: Failed to create the file ruby-1.9.2-p290.tar.bz2: Permission denied
  0 8604k    0 16150    0     0  14980      0  0:09:48  0:00:01  0:09:47 26562
curl: (23) Failed writing body (0 != 16150)
ERROR: There was an error, please check /Users/mark/.rvm/log/ruby-1.9.2-p290/*.log. Next we'll try to fetch via http.
Trying http:// URL instead.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Warning: Failed to create the file ruby-1.9.2-p290.tar.bz2: Permission denied
  0 8604k    0 16150    0     0  24640      0  0:05:57 --:--:--  0:05:57 28333
curl: (23) Failed writing body (0 != 16150)
ERROR: There has been an error while trying to fetch the source.  
Halting the installation.
ERROR: There has been an error fetching the ruby interpreter. Halting the installation.**
Foredoom answered 3/10, 2011 at 18:8 Comment(1)
Your console output is easier for us to read if you format it as code sample.Dandridge
U
17

I had the same error message, and i resolved it by doing sudo chown -R user:user /usr/local/rvm where user is your logged in user, after that i ran rvm install 1.9.2 and it completed successfully.

Unless answered 10/10, 2011 at 17:19 Comment(3)
Perhaps a better way to go about doing this is to ensure your current user is part of the rvm group. This way, you aren't mucking with permissions on the rvm directories. Simply run sudo adduser <username> rvm.Heft
I tried running sudo adduser <username> rvm and didn't seem to work.. chown did though.Vaunting
If you're going to chown the directory to a single user, just install rvm in single-user mode.Discord
R
2

I like the solution above but instead of using user:user do user:rvm.

Red answered 16/3, 2013 at 23:31 Comment(0)
D
2

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.

Discord answered 12/1, 2014 at 20:6 Comment(1)
Despite trying to reload my shell with source and verifying that I was in the rvm group, I had to log in and out to get it to work. Thanks!Knox
T
1

The error seems to be

Failed to create the file ruby-1.9.2-p290.tar.bz2: Permission denied

Did you try to do something with sudo one time? You want to make sure that /Users/mark/.rvm/rubies/ is writable for your user.

Tourer answered 3/10, 2011 at 18:18 Comment(5)
permissions are currently drwxr-xr-x 4 mark staff 136 Jul 22 22:39 rubies what should they be? I think I may have mistakenly installed rvm as root at one point...Foredoom
seems right, is there any more info in /Users/mark/.rvm/log/ruby-1.9.2-p290/*.log as to what file could not be writtten?Tourer
sadly no, there are no logs at all. which is kind of strange, right?Foredoom
What is the permissions for that directory? One thing that I have done in the past after accidentally using sudo was to just blow away ~/.rvm and start fresh.Tourer
drwxr-xr-x 4 mark staff 136 Jul 22 22:39 I'm going to try blowing ~./rvm away and curling RVM again...Foredoom
M
0

For the Devs coming in now, if you are using multi-mode rvm install, remember to add the current user to rvm group like so

rvm group add rvm $USER

Merriweather answered 12/8, 2021 at 22:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.