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

前端 未结 16 813
粉色の甜心
粉色の甜心 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:08

    A another solution similar to Max's and Adem's in this thread is found in a CocoaPods issue:

    brew install ruby
    sudo gem install cocoapods
    

    Verify that you're using the latest and correct Ruby with:

    ruby --version
    which ruby
    

    Should be using /usr/local/bin/ruby

    Reason: It turns out that Github updated to only support TLS 1.2 on Feb 22nd. Older versions of MacOS before High Sierra come preinstalled with Ruby 2.0. This version uses OpenSSL 0.9.8 which "will fail with servers supporting only TLS 1.2."

    Updating to the latest Ruby (2.5) and latest CocoaPods (1.4) fixed this for me without having to do anything with openssl (Ruby updates openssl). This is a good solution if you don't want to update to High Sierra just yet.

提交回复
热议问题