环境: macOS10.12
、Xcode 8.1
、cocoapod1.1.1
、ruby 2.2.5
电脑抹盘重装后装cocoapod后出现 [n] xxx abort
问题,且没生成workspace文件。
➜ XcodePodTest pod update
Update all pods
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Installing AFNetworking (3.1.0)
Generating Pods project
[1] 54680 abort pod update
解决方法:
➜ sudo gem install cocoapods --pre
➜ XcodePodTest pod --version
1.2.0.beta.1
更新到1.2.0.beta.1没有上述问题了。
如果更新不成功。尝试重装下cocoapods
#删除 cocoapods gems:
sudo gem uninstall cocoapods
sudo gem uninstall cocoapods-core
sudo gem uninstall cocoapods-deintegrate
sudo gem uninstall cocoapods-downloader
sudo gem uninstall cocoapods-plugins
sudo gem uninstall cocoapods-search
sudo gem uninstall cocoapods-stats
sudo gem uninstall cocoapods-try
sudo gem uninstall cocoapods-trunk
➜ sudo rm -fr ~/Library/Caches/CocoaPods/
➜ sudo rm -fr ~/.cocoapods/repos/master/
➜ ~ gem sources -l
*** CURRENT SOURCES ***
http://rubygems-china.oss.aliyuncs.com
➜ ~ gem sources -l
*** CURRENT SOURCES ***
http://rubygems-china.oss.aliyuncs.com
➜ ~ gem sources --add https://gems.ruby-china.org/ --remove http://rubygems-china.oss.aliyuncs.com
https://gems.ruby-china.org/ added to sources
http://rubygems-china.oss.aliyuncs.com removed from sources
#安装最新 pre release版本
sudo gem install cocoapods --pre
➜ ~ pod setup
Setting up CocoaPods master repo
# pod setup一般会用较长时间。 查看目标目文件夹大小
➜ ~ cd .cocoapods
➜ .cocoapods du -sh *
920M repos
再次尝试pod update
如果你有更好的解决方案,请告诉我~