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
4
  • Also, if you want to find out what group your user belongs in you can refer to this. stackoverflow.com/questions/350141/…
    Breedly
    –  Breedly
    2013-12-24 20:57:23 +00:00
    Commented Dec 24, 2013 at 20:57
  • 3
    However, you might want to be careful about changing ownerships if it has to install to the /usr/local/bin directory.
    Breedly
    –  Breedly
    2013-12-24 21:02:43 +00:00
    Commented Dec 24, 2013 at 21:02
  • 16
    Changing ownership of anything in the /usr, /Library or /var paths, among others, is a bad idea. The system can halt due to files and drivers being no longer accessible, and future updates can break if the installer senses that the paths are no longer owned by root:wheel. Fixing the damage can be really hard and is usually best done by reinstalling the OS. Naive/inexperienced users don't know enough about the OS to understand what files/directories could possibly be safe and should be cautioned to not try this at home.
    the Tin Man
    –  the Tin Man
    2014-07-31 18:41:35 +00:00
    Commented Jul 31, 2014 at 18:41
  • 1
    Lol this is an embarrassing answer. :) Older and wiser now I guess.
    Breedly
    –  Breedly
    2019-02-08 17:16:54 +00:00
    Commented Feb 8, 2019 at 17:16

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