1.替换ruby镜像
终端输入:$gem sources --remove https://rubygems.org/
然后添加国内最新镜像源(淘宝的Ruby镜像已经不更新了)
终端输入:$gem sources -a https://gems.ruby-china.com
执行完毕之后输入gem sources -l来查看当前镜像
2.安装 CocoaPods (安装到/usr/local/bin目录下)
终端输入:$ sudo gem install -n /usr/local/bin cocoapods
3.
$pod install --no-repo-update
$pod update --no-repo-update
可能出现的错误:
1.Unable to find a pod with name, author, summary, or description matching `AFNetworking`
在终端输入: $cd ~/.cocoapods/repos
$git clone https://git.coding.net/CocoaPods/Specs.git
2.CDN: trunk URL couldn't be downloaded
podfile文件中指定source源
source 'https://github.com/CocoaPods/Specs.git'
在终端输入: pod repo remove trunk (移除trunk源)