1.升级gem
sudo gem update --system
2.更新Ruby
sudo gem update -n /usr/local/bin --system
3.更新Ruby源
2.1 查看已有源(默认: https://rubygems.org/)
gem sources -l
3.2 移除原有源
gem sources --remove https://rubygems.org/
3.3 添加可用源
gem source -a https://gems.ruby-china.org/
如果出现 ERROR: SSL ... 错误则使用
gem source -a http://gems.ruby-china.org/
4.下载安装cocoapods
sudo gem install -n /usr/local/bin cocoapods --pre
pod setup
网友评论