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
  • That was the problem in my situation. You should be able to include eval "$(rbenv init -)" in your ~/.bash_profile to make all the necessary changes.
    nyi
    –  nyi
    2016-02-07 11:38:51 +00:00
    Commented Feb 7, 2016 at 11:38
  • best answer. my profile was named .bash_profile and you can open the file like this: touch ~/.bash_profile; open ~/.bash_profile and add the line you mentioned at point 1.
    CarmenA
    –  CarmenA
    2017-02-11 22:09:01 +00:00
    Commented Feb 11, 2017 at 22:09

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