wayneeseguin/rvm — Issue #670: rvm gemset copy fails with permission error
Author: dceddia
Created: 2011-12-29 04:09:08+00:00
State: open

I installed rvm, then ruby 1.9.3, and then installed rails (in the default gemset).

Then I created a new gemset for my project, and tried to copy the already-installed rails gems over.

````
$ rvm gemset copy default rmvwait
Copying gemset from default to rmvwait
Making gemset for rmvwait pristine.
ERROR: Error running '' under ,
please read /Users/dceddia/.rvm/log/ruby-1.9.3-p0/gemset.pristine.log
```

The log file shows:

````
[2011-12-28 22:20:28] rvm gemset pristine # under rmvwait
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /Library/Ruby/Gems/1.8/gems/RedCloth-4.2.8/.gemtest
Restoring gems to pristine condition...
````

After discussing with mpapis on IRC, I'm creating this issue here. Here are some relevant gists from the conversion:

rvm gemset use default ; rvm info
https://gist.github.com/1531423

rvm --trace gemset copy default rmvwait
https://gist.github.com/1531450

As an attempted workaround, I changed permissions on those system gems

sudo chown -R dceddia /Library/Ruby/Gems/1.8/gems

But this didn't solve the problem. Same error on running the gemset copy, and the log file now shows:

````
[2011-12-28 23:02:04] rvm gemset pristine # under rmvwait
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /usr/bin directory.
Restoring gems to pristine condition...
Building native extensions. This could take a while...
````

(it doesn't appear to actually build anything) But it did put some stuff in the gemspec's directory.

````
$ ls ~/.rvm/gems/ruby-1.9.3-p0\@rmvwait/gems
actionmailer-3.1.3 arel-2.2.1 json-1.6.4 rack-cache-1.1 rake-0.9.2 tzinfo-0.3.31
actionpack-3.1.3 builder-3.0.0 mail-2.3.0 rack-mount-0.8.3 rdoc-3.12
activemodel-3.1.3 bundler-1.0.21 mime-types-1.17.2 rack-ssl-1.3.2 sprockets-2.0.3
activerecord-3.1.3 erubis-2.7.0 multi_json-1.0.4 rack-test-0.6.1 thor-0.14.6
activeresource-3.1.3 hike-1.2.1 polyglot-0.3.3 rails-3.1.3 tilt-1.3.3
activesupport-3.1.3 i18n-0.6.0 rack-1.3.6 railties-3.1.3 treetop-1.4.10
````