Cocoa Pods not updating pods on El Capitan

IosCocoapodsOsx Elcapitan

Ios Problem Overview


I've upgraded to El Capitan and since then I can't update my pods.

$ pod update
-bash: pod: command not found

So I've tried to reinstall CocoaPods and got this:

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

I am the administrator on this computer. Why is this happening?

Ios Solutions


Solution 1 - Ios

This is caused by the new System integrity protection feature introduced in El Capitan. It restricts even administrators from writing to /usr/bin.

Your best option would be to install gems without needing sudo. There is a good guide on how to do that:

export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/bin:$PATH

gem install cocoapods

Solution 2 - Ios

From CocoaPods issues 3736

  1. Uninstall all instances of cocopods (just to be safe and keep things clean) see fully uninstall Cocoapods

     sudo gem uninstall cocoapods
    

or even better fully uninstall all components (and select All versions for each)

    gem list --local | grep cocoapods | awk '{print $1}' | xargs sudo gem uninstall

2. Install again

    sudo gem install -n /usr/local/bin cocoapods

3. Change access permission

    sudo chmod +rx /usr/local/bin/

Solution 3 - Ios

This should work for you

sudo gem install -n /usr/local/bin cocoapods

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

>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

>We aren't sure why gem behaves differently on some systems, but this can be solved by passing -n /usr/local/bin to the install command, so that the pod executable gets installed there.

Solution 4 - Ios

Regarding the original question/problem:

$ sudo gem install cocoapods
ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted

I found I had the same problem with several GEMS, so I generalized the recognized answer (Keith Smiley) to update ALL local gems... (on El Capitan with rootless in force)

$ sudo gem install cocoapods -n /usr/local/bin/    # this command installs
$ sudo gem update -n /usr/local/bin/    # this command updates all local gems 

This works well and will spit out a verbose log of all updates and errors.

I saw many errors. They were all 'unable to convert' errors. Parsing many docs will encounter a "skipping" error... like this:

$ unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/jazzy... skipping

I believe these skipping errors are not problems.

CocoaPods will be updated during this process, along with all the other local GEMS, depending on how current your local GEMS are. I believe this is the best way to handle the rootless issue (which is the cause of the problem).

Solution 5 - Ios

Your best option for installing Pods for custom and standard installation Refer the Link :https://github.com/CocoaPods/CocoaPods/issues/3692

enter image description here

Solution 6 - Ios

Did you install Xcode Command Line tools again ? That solved my problem. You need to select Command Line tool in Xcode preferences(Locations) and than install cocoa pods.

Solution 7 - Ios

For me it worked with: sudo gem install -n /usr/local/bin cocoapods --pre

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionLudaView Question on Stackoverflow
Solution 1 - IosKeith SmileyView Answer on Stackoverflow
Solution 2 - IosWarif Akhand RishiView Answer on Stackoverflow
Solution 3 - IosInder Kumar RathoreView Answer on Stackoverflow
Solution 4 - IosstonecanyonView Answer on Stackoverflow
Solution 5 - IosGopal RajuView Answer on Stackoverflow
Solution 6 - Iostelip007View Answer on Stackoverflow
Solution 7 - IosGKKView Answer on Stackoverflow