Error when updating gem on macOS 10.14.6

Ross's Avatar

Ross

19 Aug, 2019 03:31 PM

When updating gem on macOS 10.14.6 using the following command line:

sudo -H gem update -n /usr/local/bin --system

I get the following output, culminating in an error:

Updating rubygems-update
Fetching rubygems-update-3.0.6.gem
Successfully installed rubygems-update-3.0.6
Parsing documentation for rubygems-update-3.0.6
Installing ri documentation for rubygems-update-3.0.6
Installing darkfish documentation for rubygems-update-3.0.6
Done installing documentation for rubygems-update after 304 seconds
Parsing documentation for rubygems-update-3.0.6
Done installing documentation for rubygems-update after 0 seconds
Installing RubyGems 3.0.6
ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted @ rb_sysopen - /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/gem

If I run the same command again, I get the following output:

Latest version already installed. Done.

What is causing the error? Do I need to fix anything?

Thanks.

  1. Support Staff 1 Posted by sonalkr132 on 31 Aug, 2019 05:12 PM

    sonalkr132's Avatar

    Hi Ross,
    Sorry about the delay in response here.

    Latest version already installed. Done.

    If you see 3.0.6 for gem --version, you are all set. If not, you have to fix file permission of the directory it is erroring for. sudo chown -R $(whoami) <path>

    You can also try gem update --system and see if that works.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac