一、安装 CocoaPods
1、查看当前ruby源
gem sources -l
2、移除(所有)ruby源
gem sources --remove https://rubygems.org/
3、添加新的ruby源
gem sources -a http://gems.ruby-china.org/
4、安装cocoapods
sudo gem install cocoapods
出现如下错误:
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/xcodeproj
将命令行换成如下
sudo gem install -n /usr/local/bin cocoapods