Operation not permitted can be solved without invalidating Rootless



Thing i want to do

・Updated ruby with gem

・Install cocoapods with gem


not working

When installing gem

Faced with the problem that permission error occurs even though it is sudo (root privilege)

The cause proved to be a route-less function

In an article on the net

"Disable Route-less in Recovery Mode"

An article saying it is displayed at the top of Google search

But that is a bit deprecated

After a while searching

I could solve it without releasing the rootless

Write a story so that no one will inadvertently disable rootless.


I am sudo but I get permission error


i wanna update

sudo gem update --system


err log

Updating rubygems-update
Fetching: rubygems-update-2.6.8.gem (100%)
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/update_rubygems
ranpuraitozeroichi-no-MacBook-Pro:~ lamplight02$ sudo gem update --system
Updating rubygems-update
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/update_rubygems

reason(SIP:System Integrity Protection)「Rootless」


I must manage the function called Rootless.

The function called Rootless, if briefly explained

To strengthen security

Do not access / usr / bin / with sudo

It is a function

ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/update_rubygems


Solutions without using Recovery Mode

There is a route-less function considering security

It is forced to invalidate it

I felt sorry

So I found a way to solve in other ways

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

Can be done with the above command

sudo gem update --system -n /usr/local/bin
Updating rubygems-update
Successfully installed rubygems-update-2.6.8
Parsing documentation for rubygems-update-2.6.8
Installing ri documentation for rubygems-update-2.6.8
Installing darkfish documentation for rubygems-update-2.6.8
Parsing documentation for rubygems-update-2.6.8
Installing RubyGems 2.6.8
RubyGems 2.6.8 installed
Parsing documentation for rubygems-2.6.8
Installing ri documentation for rubygems-2.6.8

=== 2.6.8 / 2016-10-29

Bug fixes:

* Improve SSL verification failure message. Pull request #1751
by Eric Hodel.
* Ensure `to_spec` falls back on prerelease specs. Pull request
#1755 by André Arko.
* Update vendored Molinillo to 0.5.3. Pull request #1763 by
Samuel Giddins.

=== 2.6.7 / 2016-09-26

Bug fixes:

* Install native extensions in the correct location when using the
`--user-install` flag. Pull request #1683 by Noah Kantrowitz.
* When calling `Gem.sources`, load sources from `configuration`
if present, else use the default sources. Pull request #1699
by Luis Sagastume.
* Fail gracefully when attempting to redirect without a Location.
Pull request #1711 by Samuel Giddins.
* Update vendored Molinillo to 0.5.1. Pull request #1714 by
Samuel Giddins.

=== 2.6.6 / 2016-06-22

Bug fixes:

* Sort installed versions to make sure we install the latest version when
running `gem update --system`. As a one-time fix, run
`gem update --system=2.6.6`. Pull request #1601 by David Radcliffe.


RubyGems installed the following executables:

Ruby Interactive (ri) documentation was installed. ri is kind of like man
pages for ruby libraries. You may access it like this:
ri Classname
ri Classname.class_method
ri Classname#instance_method
If you do not wish to install this documentation in the future, use the
--no-document flag, or set it as the default in your ~/.gemrc file. See
'gem help env' for details.

RubyGems system software updated

Install cocoapods in the same way

Let's put cocoapods in the same way as above

sudo gem install cocoapods -n /usr/local/bin/
sudo gem install cocoapods -n /usr/local/bin/
Successfully installed xcodeproj-1.4.2
Fetching: fourflusher-2.0.1.gem (100%)
Successfully installed fourflusher-2.0.1
Fetching: gh_inspector-1.0.2.gem (100%)
Successfully installed gh_inspector-1.0.2
Fetching: cocoapods-1.1.1.gem (100%)
Successfully installed cocoapods-1.1.1
Parsing documentation for xcodeproj-1.4.2
Installing ri documentation for xcodeproj-1.4.2
Parsing documentation for fourflusher-2.0.1
Installing ri documentation for fourflusher-2.0.1
Parsing documentation for gh_inspector-1.0.2
Installing ri documentation for gh_inspector-1.0.2
Parsing documentation for cocoapods-1.1.1
Installing ri documentation for cocoapods-1.1.1
4 gems installed
LinkedIn にシェア

  • この記事を書いた人
  • 最新記事

藤沢瞭介(Ryosuke Hujisawa)



Copyright© , 2021 All Rights Reserved Powered by AFFINGER5.