Skip to main content
  1. About
  2. Stack Internal
The 2026 Annual Developer Survey is live— take the Survey today!

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

How to install a gem or update RubyGems if it fails with a permissions error

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?

Answer*

Reminder: Answers generated by AI tools are not allowed due to Stack Overflow's artificial intelligence policy

Draft saved
Draft discarded

Required fields are marked with *

Cancel
2
  • 9
    You shouldn't have to mess around with the pass yourself if you're using rbenv, if you follow the Homebrew installation instructions, all you have to do is add eval "$(rbenv init -)" to your shell config, and rbenv should take care of setting up your PATH for you.
    user456814
    –  user456814
    2014-03-01 01:49:19 +00:00
    Commented Mar 1, 2014 at 1:49
  • Thanks. I'd forgotten the 'rbenv global' so I was still using the system ruby, and gem install was failing.
    Graham Perks
    –  Graham Perks
    2014-04-06 01:55:49 +00:00
    Commented Apr 6, 2014 at 1:55

lang-rb
Morty Proxy This is a proxified and sanitized view of the page, visit original site.