rPat rPat - 5 months ago 6x
Ruby Question

Gem permission issues with rbenv running?

I am using Rbenv to manage my ruby versions, and don't remember ever having an issue before. It's been a while since I developed at home though.

Basically this is what happens:

➣ gem install rails
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
➣ rbenv local
➣ rbenv global

Really not sure what I'm missing. Never seen this issue before.


@rPat, what does the command

$ which gem

reveal? If it indicates you're using the the system gem command, try

$ rbenv rehash

and see if that resolves the issue.

Also make sure

eval "$(rbenv init -)"

is in your .bash_profile