Operation not permitted - /usr/bin/xcodeproj #3692

Closed
bryan1anderson opened this Issue Jun 16, 2015 · 7 comments

Comments

Projects
None yet
6 participants
@bryan1anderson

I get this error every time I try and run

sudo gem install cocoapods

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

@lfarah

This comment has been minimized.

Show comment
Hide comment
@lfarah

lfarah Jun 17, 2015

Getting the same thing...

lfarah commented Jun 17, 2015

Getting the same thing...

@neonichu

This comment has been minimized.

Show comment
Hide comment
@neonichu

neonichu Jun 17, 2015

Member

Obviously, we need a bit more information, e.g. what OS version you are running on.

Member

neonichu commented Jun 17, 2015

Obviously, we need a bit more information, e.g. what OS version you are running on.

@lfarah

This comment has been minimized.

Show comment
Hide comment
@lfarah

lfarah Jun 17, 2015

I'm running El Capitan. Was forced to downgrade and now it works

lfarah commented Jun 17, 2015

I'm running El Capitan. Was forced to downgrade and now it works

@segiddins

This comment has been minimized.

Show comment
Hide comment
@segiddins

segiddins Jun 17, 2015

Member

the issue here is rootless and the default gem home conflicting

Member

segiddins commented Jun 17, 2015

the issue here is rootless and the default gem home conflicting

@abelsu

This comment has been minimized.

Show comment
Hide comment
@abelsu

abelsu Jun 20, 2015

How to slove it ? I get the same thing:-(

abelsu commented Jun 20, 2015

How to slove it ? I get the same thing:-(

@bspringston

This comment has been minimized.

Show comment
Hide comment
@bspringston

bspringston Jun 21, 2015

Also on OS X El Capitan and getting the same error. Any known resolution without downgrading?

Also on OS X El Capitan and getting the same error. Any known resolution without downgrading?

@CocoaPods CocoaPods locked and limited conversation to collaborators Jun 21, 2015

@neonichu

This comment has been minimized.

Show comment
Hide comment
@neonichu

neonichu Jun 21, 2015

Member

Installing CocoaPods on OS X 10.11 and macOS 10.12

These instructions were tested on all betas and the final release of El Capitan, also on betas of Sierra.

Custom GEM_HOME

This is the solution when you are receiving the "Operation not permitted" error.

$ mkdir -p $HOME/Software/ruby
$ export GEM_HOME=$HOME/Software/ruby
$ gem install cocoapods
[...]
1 gem installed
$ export PATH=$PATH:$HOME/Software/ruby/bin
$ pod --version
0.37.2

Standard system installation

For whatever reason, the rootless stuff seems less restrictive when one simply upgrades the system. I could sudo gem install cocoapods just fine on a machine upgraded from 10.10 - however, binstubs are no longer installed into /usr/bin:

$ sudo gem install cocoapods
[...]
1 gem installed
$ export PATH=$PATH:/Library/Ruby/bin
$ pod --version
0.37.2

We have heard from some users that they receive this error when doing a system-wide installation:

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

This happens when you have updated the rubygems gem of your system ruby installation, but this can be solved by passing -n /usr/local/bin to the install command, so that the pod executable gets installed there. The issue here is that the default gem that ships with the system has a customised binary directory, but any newer version you install (e.g. via gem update --system) does not.

Note: I've locked the issue to collaborators so that these instructions don't get buried for now.

Member

neonichu commented Jun 21, 2015

Installing CocoaPods on OS X 10.11 and macOS 10.12

These instructions were tested on all betas and the final release of El Capitan, also on betas of Sierra.

Custom GEM_HOME

This is the solution when you are receiving the "Operation not permitted" error.

$ mkdir -p $HOME/Software/ruby
$ export GEM_HOME=$HOME/Software/ruby
$ gem install cocoapods
[...]
1 gem installed
$ export PATH=$PATH:$HOME/Software/ruby/bin
$ pod --version
0.37.2

Standard system installation

For whatever reason, the rootless stuff seems less restrictive when one simply upgrades the system. I could sudo gem install cocoapods just fine on a machine upgraded from 10.10 - however, binstubs are no longer installed into /usr/bin:

$ sudo gem install cocoapods
[...]
1 gem installed
$ export PATH=$PATH:/Library/Ruby/bin
$ pod --version
0.37.2

We have heard from some users that they receive this error when doing a system-wide installation:

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

This happens when you have updated the rubygems gem of your system ruby installation, but this can be solved by passing -n /usr/local/bin to the install command, so that the pod executable gets installed there. The issue here is that the default gem that ships with the system has a customised binary directory, but any newer version you install (e.g. via gem update --system) does not.

Note: I've locked the issue to collaborators so that these instructions don't get buried for now.

@neonichu neonichu closed this Jun 21, 2015

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.