cocopods 1.1.1更新失敗

pod update
//錯誤
Updating local specs repositories
[!] The `master` repo requires CocoaPods 1.0.0 -  (currently using 0.39.0)
Update CocoaPods, or checkout the appropriate tag in the repo.

于是更新cocopods

sudo gem install cocoapods
//依舊失敗
ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted - /usr/bin/xcodeproj

猜測是gem版本太低,于是繼續

sudo gem update --system
//還是失敗
Updating rubygems-update
Fetching: rubygems-update-2.6.8.gem (100%)
ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted - /usr/bin/update_rubygems

查看了一下gem的版本

gem -v
2.6.1

從網上尋找解決辦法

sudo gem install -n /usr/local/bin cocoapods
//顯示如下
Successfully installed xcodeproj-1.4.1
Fetching: molinillo-0.5.4.gem (100%)
Successfully installed molinillo-0.5.4
Fetching: gh_inspector-1.0.2.gem (100%)
....省略好多行

再次執行

pod update
//失敗
Performing a deep fetch of the `master` specs repo to improve future performance
[!] /usr/bin/git -C /Users/jing/.cocoapods/repos/master fetch --unshallow

error: RPC failed; curl 56 SSLRead() return error -9806
fatal: The remote end hung up unexpectedly

然后執行

pod repo update --verbose
//顯示如下
$ /usr/bin/git -C /Users/jing/.cocoapods/repos/master pull --ff-only
  From https://github.com/CocoaPods/Specs
     544d169..d362e91  master     -> origin/master
  Updating c479d4f..d362e91
......
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

然后

pod update
//錯誤如下
[!] The dependency `xxxx` is not used in any concrete target.
The dependency `xxxx` is not used in any concrete target.The The dependency `xxxx` is not used in any concrete target.
The dependency `xxxx` is not used in any concrete target.

解決方法如下://加上target:
將Podfile中的代碼改成如下形式即可。

platform :ios, '8.0'
use_frameworks!
target 'MyApp' do
pod 'AFNetworking', '~> 2.6'
pod 'ORStackView', '~> 3.0'
pod 'SwiftyJSON', '~> 2.3'
end
備注:另外,可以通過pod init命令在工程文件夾下生成一個默認的Podfile文件。

更改完成后

pod repo update --verbose
pod update
//顯示如下(成功)
Analyzing dependencies
Downloading dependencies
Installing AFNetworking (3.1.0)
Installing ........
Sending stats
Pod installation complete! There are 14 dependencies from the Podfile and 15 total pods installed.

成功。。。。

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • CocoaPods 是什么? CocoaPods 是一個負責管理 iOS 項目中第三方開源庫的工具。CocoaPo...
    朝洋閱讀 25,743評論 3 50
  • 項目組件化、平臺化是技術公司的共同目標,越來越多的技術公司推崇使用pod管理第三方庫以及私有組件,一方面使項目架構...
    swu_luo閱讀 22,248評論 0 39
  • Ruby 安裝 要安裝cocospods 首先需要安裝ruby,可以先安裝xcode,再安裝macport ,最后...
    山天大畜閱讀 1,897評論 0 1
  • 2017年3月15日,重慶,幾座“男用英式公廁”亮相洋人街景區路邊。 這些供男士小便專用的露天公廁,每座有4個站位...
    印象智慧游閱讀 758評論 0 0
  • 下午滿懷期待地去見老板,結果被訓得體無完膚。他聽到我的問題后,發了很大的火,我真覺得自己是個弱智。 一出門,眼淚就...
    敬哥閱讀 246評論 0 0