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

终端执行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成功。

你可能感兴趣的