系統版本:macOS Sierra 10.12.6git
Xcode: v9.2(9C40b)github
當咱們使用pod update
或者 pod repo update
時,可能會出現 [!] Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offline, or that GitHub is down
問題ruby
一開始我認爲是網絡問題,後來頻繁的出現我發現是連接github出現了問題。
在stackoverflow 我找到了解決辦法。bash
在這裏能夠看到出現這個問題的緣由,以及解決的辦法網絡
2018年2月以後,其中一個主要問題是「弱密碼標準被刪除」。curl
To solve this, first you need to update openssl, then ruby, then cocoapod.ui
開始搬運代碼this
$ which openssl /usr/bin/openssl $ openssl version OpenSSL 0.9.8zh 14 Jan 2016 $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" $ 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.6.0-dev : $ rbenv install 2.5.0 $ rbenv versions * system (set by /Users/username/.rbenv/version) 2.5.0 $ ruby --version ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16] $ rbenv global 2.5.0 $ rbenv versions system * 2.5.0 (set by /Users/username/.rbenv/version) $ ruby --version ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16] $ gem install cocoapods -n /usr/local/bin $ which pod /usr/local/bin/pod $ pod --version 1.4.0
成功走到最後,則表明安裝成功了,能夠放心的pod update
和 pod repo update
了google
Ruby選擇的版本必須是大於2.0.0版本,最好是選擇最新的例如 2.5.0 或者 2.5.1url
在 2018.4.24你pod可能更新的是1.5.0版本,這個關係不大
還有一種解決方案 是每次須要更新你的repo時,將老版本的repo刪除,從新下載
$sudo rm -fr ~/.cocoapods/repos/master $pod setup $pod install