Failed to connect to GitHub to update the CocoaPods/Specs specs repo 問題

今天pod search 一個(gè)庫時(shí)發(fā)現(xiàn)搜索到的版本比github上的最新版本舊,于是采用下面的命令更新Cocoapods的庫

pod repo update master --verbose

執(zhí)行后卻報(bào)了下面的錯(cuò)誤:

Updating spec repo `master`
[!] Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offline, or that GitHub is down

這是為何呢,明明不久前剛剛更新Cocoapods為1.3.1版本啊。

搜索才發(fā)現(xiàn)是Github在不久之前的2018年2月23號(hào)移除了一些低加密標(biāo)準(zhǔn)協(xié)議,包括TLSv1/TLSv1.1,diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,相關(guān)鏈接在這里:Weak cryptographic standards removed

這就意味著Mac系統(tǒng)對(duì)應(yīng)的openssl也需要更新。

這里提供了全套升級(jí)辦法,搬運(yùn)過來:

$ 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.1.0
  2.1.1
  2.1.2
:

$ rbenv install 2.1.0

$ rbenv versions
* system (set by /Users/username/.rbenv/version)
  2.1.0

$ ruby --version
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]

$ rbenv global 2.1.0

$ rbenv versions
  system
* 2.1.0 (set by /Users/username/.rbenv/version)

$ ruby --version
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin16.0]

$ gem install cocoapods -n /usr/local/bin

$ which pod
/usr/local/bin/pod

$ pod --version
1.4.0

完成上面一系列操作后,Cocoapods將會(huì)升級(jí)到最新的1.4.0版本。再執(zhí)行pod repo update master --verbose就沒有問題了。

?著作權(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)容