Search code examples
angularionic-frameworkionic2ionic3

On MAC system - CocoaPods was not found -- while doing Ionic - Add or Remove phonegap-push-plugin -


Error: CocoaPods was not found. Please install version 1.0.1 or greater from https://cocoapods.org/

I know this is the solution

ionic cordova plugin remove phonegap-plugin-push 
sudo gem install cocoapods

Then you need to sync the cocoapods repo

pod setup

This may take a while Finally install push

ionic plugin add phonegap-plugin-push --variable SENDER_ID="XXXXXXX"

My OS is MAC

But it is still not working.


Solution

  • You cannot run CocoaPods as root.

    To install push you must first install cocoapods.

    Follow these steps on your terminal in the Ionic project directory.

    First remove what you tried to install

    ionic plugin remove phonegap-plugin-push
    

    Next install cocoapods

    sudo gem install cocoapods
    

    Then you need to sync the cocoapods repo

    pod setup # (run as normal user not as root)
    

    This may take a while

    Finally install push

    ionic plugin add phonegap-plugin-push --variable SENDER_ID="XXXXXXX"
    

    Then change ownership of folders required

    chmod -R 777 /usr/etc/
    

    So basically you come out of sudo -i then run as normal osx user