Cocoapods: Failed to connect to GitHub to update the CocoaPods/Specs specs repo

前端 未结 16 597
粉色の甜心
粉色の甜心 2020-11-30 16:25

When running pod repo update the following error is generated:

Updating spec repo `master`
[!] Failed to connect to GitHub to update the CocoaPo         


        
相关标签:
16条回答
  • 2020-11-30 17:09

    For me the below commands fixed the issue

    Removing cocoapods from mac

     sudo gem uninstall cocoapods
    

    Installing cocoapods on mac

    sudo gem install cocoapods
    
    0 讨论(0)
  • 2020-11-30 17:12

    One of the major issue is "weak cryptographic standards removed" after 2018 February.

    Here a note: https://github.com/blog/2507-weak-cryptographic-standards-removed

    To solve this, first you need to update openssl, then ruby, then cocoapod.

    $ which openssl
    /usr/bin/openssl
    
    $ openssl version
    OpenSSL 0.9.8zh 14 Jan 2016
    
    $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
    
    $ brew update
    
    $ brew install openssl
    
    $ brew upgrade openssl
    
    `` If you need to have this software first in your PATH run: echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
    
    $ echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
    $ source ~/.bash_profile
    
    $ which openssl
    /usr/local/opt/openssl/bin/openssl
    
    $ openssl version
    OpenSSL 1.0.2n  7 Dec 2017
    
    $ brew install rbenv ruby-build
    
    $ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
    $ echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
    $ source ~/.bash_profile
    
    $ rbenv install --list
    
    Available versions:
      1.8.5-p52
      1.8.5-p113
      1.8.5-p114
      1.8.5-p115
      1.8.5-p231
      1.8.6
    :
      2.5.0-rc1
      2.5.0
      2.5.1
      2.6.0-dev
    :
    
    $ rbenv install 2.5.1
    
    $ rbenv versions
    * system (set by /Users/username/.rbenv/version)
      2.5.1
    
    $ ruby --version
    ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
    
    $ rbenv global 2.5.1
    
    $ rbenv versions
      system
    * 2.5.1 (set by /Users/username/.rbenv/version)
    
    $ ruby --version
    ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin16]
    
    $ gem install cocoapods -n /usr/local/bin
    
    $ which pod
    /usr/local/bin/pod
    
    $ pod --version
    1.5.3
    

    now, you can do

    $ pod update
    

    source link: https://qiita.com/satoshi-iwaki/items/ed2c267127dcc80baa21

    0 讨论(0)
  • 2020-11-30 17:17

    Anyone facing any similar issue where the remote hangs-up prematurely, use ssh to clone the repo instead.

    git clone git@github.com:CocoaPods/Specs.git master.

    In order to use SSH to clone a GitHub repo, you need to have a GitHub account and have your SSH keys associated with it.

    Follow their documentation here.

    0 讨论(0)
  • 2020-11-30 17:20

    This worked like magic

    $sudo rm -fr ~/.cocoapods/repos/master
    $pod setup
    $pod install
    

    Otherwise

    $pod setup
    Ctrl +C
    cd ~/.cocoapods/repos 
    $git clone --depth 1 https://github.com/CocoaPods/Specs.git master
    
    0 讨论(0)
  • 2020-11-30 17:21

    Finally managed to solve it by deleting ./cocoapods/repos/master and running pod install.

    The more formal solution would probably go like this:

    pod repo remove master
    pod setup
    pod install
    

    If pod install fails after performing the first two steps, you may need to delete your Podfile.lock.

    Why it initially failed to connect to Github is beyond me.

    0 讨论(0)
  • 2020-11-30 17:21

    This worked for me:

    1. Remove Podfile.lock
    2. Run pod install
    0 讨论(0)
提交回复
热议问题