wayneeseguin/rvm — Issue #748: RVM multi-user installation tries to delete system rubygems
Author: barnaba
Created: 2012-02-10 16:59:01+00:00
State: open

Hello,

I've performed multi-user install of rvm on a server, where ree is the system ruby.

$ ruby --version
ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 20090928

$ whereis ruby
ruby: /usr/bin/ruby /usr/lib/ruby /usr/lib64/ruby /opt/ruby-enterprise/bin/ruby /opt/ruby-enterprise-1.8.7-20090928/bin/ruby

When I try to install new version of ruby (without rvmsudo) installation of rubygems fails:

....
rm: cannot remove `/opt/ruby-enterprise-1.8.7-20090928/lib/ruby/site_ruby/1.8/rubygems.rb': Permission denied
Installing rubygems-1.8.15 for system ...
Error running 'GEM_PATH=":@global" GEM_HOME="" "/usr/local/rvm/rubies/system/bin/ruby" "/usr/local/rvm/src/rubygems-1.8.15/setup.rb"', please read /usr/local/rvm/log/system/rubygems.install.log
Installation of rubygems did not complete successfully.

I suspect, that using rvmsudo for this installation (or upgrade of rubygems) will help, but this is a production server and I'm afraid that it will brake things that are currently using system ruby.

This issue occurs in the stable and current versions of RVM. I get the same problem when I try installing ruby 1.9.2.

Heres the full log:
https://gist.github.com/1790752