I'm trying to install a gem using gem install mygem
or update RubyGems using gem update --system
, and it fails with this error:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
Does anyone have an idea how to solve this?
Try adding --user-install
instead of using sudo
:
gem install mygem --user-install