一、更新版本
1、sudo gem update -n /usr/local/bin --system
2、sudo gem uninstall cocoapods
3、sudo gem install -n/usr/local/bin cocoapods
4、pod setup 可以不做此操作
二、命令總結
1、gem -v gem版本
2、pod --version cocoapods版本
3、ruby -v ruby版本
4、sudo gem update -n /usr/local/bin --system 更新gem
5、sudo gem install -n /usr/local/bin cocoapods 更新pod
6、sudo rm-fr ~/Library/Caches/CocoaPods/
和 sudo rm -fr ~/.cocoapods/repos/master 刪除全局的緩存
7、sudo rm -fr Pods/ 把當前Pods目錄清空
8、gem uninstall cocoapods 卸載pod(有時候更新cocoapods會出現兩個pod共存的問題,可以刪除其中一個)
三、多個target的時候Podfile
platform :ios, '9.0'
use_frameworks!
# My other pods
def testing_pods
pod 'Quick', '0.5.0'
pod 'Nimble', '2.0.0-rc.1'
end
target 'MyTests' do
testing_pods
end
target 'MyUITests' do
testing_pods
end
三、相關資料
1、For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.2.0.rc.1