1、升级Ruby环境
sudo gem update --system
2、更新cocoapods
sudo gem install -n /usr/local/bin cocoapods
3、更新repo(这一步会比较漫长。。。)
pod repo update
或是
pod install --repo-update
4、降级:
卸载当前版本:sudo gem uninstall cocoapods
下载旧版本:sudo gem install cocoapods -v 1.11.2
5、查看本地gem源及更换源
命令:gem sources -l
删除gem源:gem sources -r https://rubygems.org/
新增gem源:gem sources --add https://gems.ruby-china.com