查看當(dāng)前安裝了哪些版本
gem list --local | grep cocoapods
如果你安裝了多個(gè)版本那么你將看到

先刪除已經(jīng)裝過(guò)的版本(可能有幾個(gè),卸載的時(shí)候會(huì)讓你輸入1,2..n選擇卸載那個(gè)版本
sudo gem uninstall cocoapods
或者強(qiáng)制卸載某一個(gè)版本
gem uninstall cocoapods -v 0.20.2
安裝某一個(gè)版本
sudo gem install cocoapods -v 0.35.0
pod install --verbose --no-repo-update 不跟新pod應(yīng)用庫(kù)
error 錯(cuò)誤:
[!] Unable to satisfy the following requirements:
- `AFNetworking (~> 2.3.1)` required by `Podfile`
Specs satisfying the `AFNetworking (~> 2.3.1)` dependency were found, but they required a higher minimum deployment target.
解決方案:Podfile 文件 中 ??platform:ios,?‘8.0’??后邊的 8.0 是平臺(tái)版本號(hào) ,一定要加上
ERROR:? While executing gem ... (Errno::EPERM) ?Operation not permitted - /usr/bin/xcodeproj
版本更新問(wèn)題:使用 sudo gem install -n /usr/local/bin cocoapods