1、先切换gem源(可忽略)
gem sources --remove https://rubygems.org/
gem source -a https://gems.ruby-china.org
查看是否切换成功
gem source -l
打印出*** CURRENT SOURCES ***
https://gems.ruby-china.org
就说明切换成功,如果还是官方的源, 请手动重启电脑尝试
2、升级cocoapods
sudo gem install -n /usr/local/bin cocoapods --pre
3、查看版本(可忽略)
pod --version
4、设置pod仓库
pod setup
至此, 已经升级了
pod search 搜索不到先删除在执行试试
rm ~/Library/Caches/CocoaPods/search_index.json
pod search AFNetworking
网友评论