Unable to install cocoa pods

后端 未结 3 1774
一整个雨季
一整个雨季 2021-01-17 15:13

I want to install cocoapods on MacOS to run the pod command. But on doing

sudo gem install cocoa-pods

I get the following:

Bui         


        
相关标签:
3条回答
  • 2021-01-17 15:39

    I think the most reliable solution is to use:

    brew install cocoapods
    

    Which should resolve missing / corrupted dependencies on its own.

    PS: This obviously involves installing brew, but I am willing to bet you already have it in your system.

    0 讨论(0)
  • 2021-01-17 15:46

    Here is what I did on my Mojave machine:

    • brew reinstall cocoapods
    • brew link --overwrite cocoapods, override the default pod
    $ brew reinstall cocoapods
    ==> Downloading https://homebrew.bintray.com/bottles/cocoapods-1.9.3.mojave.bottle.tar.gz
    ==> Downloading from https://akamai.bintray.com/07/074e5b53b7a054c132582183dcf47546ffffd028a7beb9fcdc653fe4a43225bcf3?__gda__=exp=1593894546~hmac=8b
    ######################################################################## 100.0%
    ==> Reinstalling cocoapods
    ==> Pouring cocoapods-1.9.3.mojave.bottle.tar.gz
    Error: The `brew link` step did not complete successfully
    The formula built, but is not symlinked into /usr/local
    Could not symlink bin/pod
    Target /usr/local/bin/pod
    already exists. You may want to remove it:
      rm '/usr/local/bin/pod'
    
    To force the link and overwrite all conflicting files:
      brew link --overwrite cocoapods
    
    To list all files that would be deleted:
      brew link --overwrite --dry-run cocoapods
    
    Possible conflicting files are:
    /usr/local/bin/pod
    /usr/local/bin/xcodeproj
    ==> Summary
                                                                        
    0 讨论(0)
  • 2021-01-17 15:48

    I had a similar issue. I solved by installing the latest version of ruby (2.7.2).

    First install the Ruby Version Manager rvm:

    curl -L https://get.rvm.io | bash -s stable
    

    Then install the latest version of ruby:

    rvm install ruby-2.7.2
    

    Finally try again to install the cocoapods:

    sudo gem install cocoapods
    
    0 讨论(0)
提交回复
热议问题