今天升级cocoapods时 先看了下当前版本 pod --version 是1.5.几来着,不管了,反正需要升级 ,ok, 输入 sudo gem install -n /usr/local/bin cocoapods --pre
结果报错 Could not find a valid gem 'cocoapods' (>= 0), here is why: Unable to download data from https://gems.ruby-china.org/ - bad response Not Found 404 (https://gems.ruby-china.org/specs.4.8.gz)
额,镜像有问题(我用的是https://gems.ruby-china.org的镜像),难道要换成taobao的,那就换呗
gem sources --remove https://gems.ruby-china.org
gem sources -a https://ruby.taobao.org/
结果还是报错 ERROR: Certificate /C=CN/ST=ZheJiang/L=HangZhou/O=Alibaba (China) Technology Co., Ltd./CN=*.taobao.org expired at 2018-12-05T03:16:02Z
Error fetching https://ruby.taobao.org/:
SSL_connect returned=1 errno=0 state=error: certificate verify failed (https://ruby.taobao.org/specs.4.8.gz)
??? 一脸懵逼,怎么这个也不行了~~~
然后各种查资料,网上各种方式尝试,都无果.最后点进网站一下就明白了
ok,letsgo
gem sources -a https://gems.ruby-china.com
gem sources -l
成功
接下來就正常了 sudo gem install -n /usr/local/bin cocoapods --pre
最后pod --version看了下 1.7.0