3
$ gem install passenger
Fetching: passenger-4.0.5.gem (100%)
ERROR:  While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Users/snowcrash/.rvm/gems/ruby-2.0.0-p195 directory.
$ ls -ld /Users/snowcrash/.rvm/gems/ruby-2.0.0-p195
drwxrwsr-x  8 root  rvm  272 21 May 16:07 /Users/snowcrash/.rvm/gems/ruby-2.0.0-p195

Clearly my version of ruby is owned by root/rvm.

I'm not happy with this SO answer which suggests making .gem/specs world-writable: Permission denied error with RVM

and this SO answer is for a specific gem: Error while executing gem...Permission Denied

Any better suggestions?

Perhaps repair permissions / ownership on the .rvm directory?

Community
  • 1
  • 1
Snowcrash
  • 73,844
  • 72
  • 228
  • 347

2 Answers2

11

RVM has a command to fix permissions:

rvm get head
rvm fix-permissions
mpapis
  • 52,024
  • 14
  • 118
  • 159
0

You can try to take ownership of the .rvm directory with something like:

sudo chown -R groupname:username /Users/username/.rvm

Where username is your user login name. The groupname is optional.

Rob O
  • 3
  • 2
Ian Kenney
  • 6,166
  • 1
  • 24
  • 42