1. 安装
sudo gem update --system
gem sources --remove https://rubygems.org/
gem sources --add https://gems.ruby-china.com/
sudo gem install -n /usr/local/bin cocoapods
2.更换国内镜像并使用
cd ~/.cocoapods/repos
pod repo remove master
git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git master
pod setup // 不要忘记这一步,这一步是把master 装配上
后面在对应Podfile文件追究source,例如:
source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'