安装

来自:https://www.jianshu.com/p/fb7f533c39fc

gem sources --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.com/
sudo gem install cocoapods
pod setup

配置

来自:https://www.jianshu.com/p/4a118f93e6ed

cd ~/.cocoapods/repos
pod repo remove master
git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git master
# 再改回来
cd master
git remote set-url origin https://github.com/CocoaPods/Specs.git