1.查看当前的ruby:ruby -v
2.升级ruby:gem update --system
3:查看当前镜像文件:gem sources -l
4.如果为空,添加镜像文件:gem source -a https://gems.ruby-china.com
5:查看当前镜像文件,如果存在多个删除从新添加:
gem sources --remove https://rubygems.org/
6.安装:sudo gem install -n /usr/local/bin cocoapods
7:cd到你工程所在目录:pod install
8:done