Search code examples
xcodecocoapodsmacos-sierra

sudo gem install cocoapods getting error


Unable to install 'cocoapods' in my mac. I am currently using macOS Sierra.

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

Solution

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

    If you don't want to do that, you can install CocoaPods to your home folder:

    export GEM_HOME=~/.gems
    export PATH=$GEM_HOME/bin:$PATH
    
    gem install cocoapods