更新gem
$ sudo gem update -n /usr/local/bin --system
更新Ruby源
$ gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
检查Ruby源
$ gem sources -l
https://gems.ruby-china.com
确保只有gems.ruby-china.com
如果安装了多个Xcode,用以下命令选择
$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
安装Cocoapods
$ sudo gem install -n /usr/local/bin cocoapods
安装指定版本的Cocoapods
$ sudo gem install -n /usr/local/bin cocoapods -v 1.5.3
网友评论