pod update -- Failed to connect to GitHub to update the CocoaPods/Specs specs repo

weixin_34391445發表於2018-04-17

終端執行pod setup pod update 報錯 -- [!] Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offline, or that GitHub is down

1. 如果你的Ruby執行環境大於2.0.0的話可以升級cocoapods解決,檢視當前ruby終端命令ruby -v

可以參考:http://blog.csdn.net/potato512/article/details/62235282

    1、更新gem:sudo gem update --system

    2、刪除gem源:gem sources --remove https://ruby.taobao.org/

    3、修改gem源:gem sources -a https://gems.ruby-china.org

    4、檢視gem源是否是最新的:gem sources -l

    5、升級cocoapods:sudo gem install -n /usr/local/bin cocoapods --pre

    6、檢視升級後的cocoapods版本:pod --version

但是在修改gem源時會報錯

Error fetching https://gems.ruby-china.org:

Errno::ECONNREFUSED: Failed to open TCP connection to localhost:8118 (Connection refused - connect(2) for "localhost" port 8118) (https://gems.ruby-china.org/specs.4.8.gz)

根據提示考慮到應該是自己使用ss代理的問題

使用:env|grep -i proxy檢視自己的代理設定

http_proxy=http://localhost:8118

https_proxy=http://localhost:8118

使用:unset https_proxy  

unset http_proxy

後      env|grep -i proxy檢視自己的代理設定為空

再修改gem源:gem sources -a https://gems.ruby-china.org成功。

相關文章