在用cocoapods導(dǎo)入第三方庫的時(shí)候報(bào)了這個(gè)錯(cuò)滨砍,嘗試了多種方法
終端ping了一下github.com箭养,
ping github.com?
發(fā)現(xiàn)連接超時(shí),打開鏈接?http://ping.chinaz.com?輸入?github.com?,點(diǎn)擊Ping檢測
找到延遲最小的ip,我的是140.82.112.3 ,復(fù)制后打開
sudo vim /etc/hosts
輸入開機(jī)密碼畜份。然后在最后面添加
140.82.112.3 github.com
再ping github.com ,ping通了欣尼,然后在cd到項(xiàng)目目錄爆雹,執(zhí)行pod install,還是連接不上愕鼓。繼續(xù)找原因钙态。又是一通查找...
關(guān)閉代理,然后終端執(zhí)行
git config--global--unsethttps.proxy
git config--global--unsethttp.proxy????????????
再pod install 依然沒有效果菇晃!失敳岬埂!
又經(jīng)過一番查到磺送,最后懷疑可能是.gitconfig配置出錯(cuò)驻子,打開.gitconfig
open ~/.gitconfig
添加這一段[url "https://hub.fastgit.org"] insteadOf = https://github.com,如果是http的就把insteadOf = https://github.com替換成insteadOf = http://github.com
貼下我的.gitconfig里面的內(nèi)容估灿,作為參考
[http]
? ? ? ? ? ? ?postBuffer = 524288000
? ? ? ? ? ? ?postBuffer = 524288000
? ? ? ? ? ? ?postBuffer = 524288000
? ? ? ? ? ? ?postBuffer = 524288000
? ? ? ? ? ? ?lowSpeedLimit = 0
? ? ? ? ? ? ?lowSpeedTime = 999999
[core]
? ? ? ? ? ? ?compression = 9
? ? ? ? ? ? ?excludesfile = /Users/ronie/.gitignore_global
[user]
? ? ? ? ? ? ?name =***
? ? ? ? ? ? ?email = **************
[url "https://hub.fastgit.org"]
? ? ? ? ? ? ?insteadOf = http://github.com
再pod install崇呵,成功了
2022-03-22 更新一下
修改了.gitconfig里面的內(nèi)容之后,Line可以安裝了甲捏,但是其他庫又用不了了,提示報(bào)錯(cuò):
[!] Error installing XXX?
....
....
....
...LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
pod update之后提示
[!] CocoaPods was not able to update themasterrepo. If this is an unexpected issue and persists you can inspect it running ’pod repo update --verbose’
看到這個(gè)熟悉的報(bào)錯(cuò)鞭执,直接升級ruby
brew install ruby
升級ruby過程中又遇到報(bào)錯(cuò)
==> Pouring python@3.9-3.9.7_1.big_sur.bottle.tar.gzError: No such file or directory @ rb_sysopen - /Users/*****/Library/Caches/Homebrew/downloads/8049a4964d208b824a1a66fcb90a9a07d6a17033b899ae8c6609bf5ec2e01771--python@3.9-3.9.7_1.big_sur.bottle.tar.gz?
Python包安裝出錯(cuò)司顿,直接單獨(dú)安裝該包,如遇其他包出錯(cuò)兄纺,同樣處理
brew install python
更完了再執(zhí)行pod install,繼續(xù)報(bào)錯(cuò)
unable to access 'https://hub.fastgit.org/CocoaPods/Specs.git/': LibreSSL SSL_connect: Connection reset by peer in connection to hub.fastgit.org:443
發(fā)現(xiàn)是.gitconfig?里面配置的清華大學(xué)的源替換了http://github.com大溜,只能再打開.gitconfig的配置文件
open ~/.gitconfig
刪掉
[url "https://hub.fastgit.org"] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?insteadOf = http://github.com
那之前是白改了?估脆?钦奋?
再執(zhí)行pod install,成功了.....