1、更新gem:sudo gem update --system
2、以前的淘宝镜像没用了,得移除掉:gem sources --remove https://ruby.taobao.org/
3、修改新的镜像:gem sources -a https://gems.ruby-china.org
4、gem sources -l 然后查看gem sources源是不是 https://gems.ruby-china.org
5、升级cocoapods:sudo gem install -n /usr/local/bin cocoapods --pre
6、查看升级后的cocoapods版本:pod --version