Cocoapods錯(cuò)誤: Failed to connect to GitHub to update the MacDownApp/cocoapods-specs specs repo

今天升級(jí)項(xiàng)目Cocoapods管理的第三方庫, 用pod update --no-repo-update更新庫,有的庫的版本反而降低了(團(tuán)隊(duì)開發(fā)),這真的是莫名其妙. 然后用了pod install, pod install --no-repo-update, pod update, pod repo update等命令,都報(bào)以下這個(gè)錯(cuò)誤:

Failed to connect to GitHub to update the MacDownApp/cocoapods-specs specs repo - Please check if you are offline, or that GitHub is down

這個(gè)問題跟 GitHub 有關(guān)系, 主要是 GitHub.com 刪除了對(duì)弱密碼標(biāo)準(zhǔn)的支持:
TLSv1/TLSv1.1, diffie-hellman-group1-sha1, diffie-hellman-group14-sha1
https://blog.github.com/2018-02-23-weak-cryptographic-standards-removed/

然后我在 stackoverflow 上找到了該問題的解決方案,親測(cè)可用, 現(xiàn)把它搬運(yùn)過來, 如下(侵刪):

首先更新openssl,然后更新ruby,最后升級(jí)cocoapod。
$ 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

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容