從網上下載的工程第三方庫需要更新,但當我執行pod update時提示以下錯誤:
[!] The `master` repo requires CocoaPods 1.0.0 - (currently using 0.39.0)
查看當前CocoaPods版本:
pod --version
0.39.0
說明我們需要更新CocoaPods的版本了
gem source -l
查看當前的鏡像
把已有的都進行移除

並只添加這一個鏡像
gem source -a https://gems.ruby-china.org
再使用gem source -l查看是否是唯一的鏡像
sudo gem install -n /usr/local/bin cocoapods --pre
sudo gem update --system
但是這時候我查看cocoapod的版本還是0.39.0
這時候再去執行
提示錯誤:
ERROR: While executing gem ... (URI::InvalidURIError)
bad URI(is not URI?): ?gems=–pre

執行pod setup
提示錯誤:
fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': SSLRead() return error -9845
[!] CocoaPods was not able to update the `master` repo. If this is an unexpected issue and persists you can inspect it running `pod repo update --verbose`

按照她的提示,輸入:
pod repo update --verbose
這時候貌似要成功了,它會提示:
CocoaPods 1.2.0.beta.1 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
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.beta.1

再使用命令sudo gem install cocoapods --pre
但又提示錯誤:
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/pod

再輸入:
sudo gem install -n /usr/local/bin cocoapods --pre
就完美的解決問題了
這是因為10.11的系統把pod目錄已到了usr文件夾下,可以在finder中前往/usr/local/bin文件夾查看

查看當前cocoapods版本
1.2.0.beta.1、

完美
