CocoaPods版本升級那些坑

原文http://www.finalshares.com/read-6482?fr=gn

主題CocoaPods

下載某個ios源碼后,控制器進(jìn)入目錄執(zhí)行pod install:

$ podinstallAnalyzing dependencies[!] TheversionofCocoaPods usedtogenerate the lockfile (0.39.0)ishigherthantheversionofthecurrentexecutable (0.35.0). Incompatibility issues may arise.

因此我們需要更新cocoapods,執(zhí)行下面的命令,但是并沒有更新成功。

$ gemupdatecocoapodUpdating installed gemsNothingtoupdate

查看當(dāng)前版本:

$ pod--version0.35.0

懷疑source地址有變化:

$ gem sources -l*** CURRENT SOURCES ***http://ruby.taobao.org/

網(wǎng)上查看,告知taobao服務(wù)器已經(jīng)改為https協(xié)議,因此執(zhí)行如下:

$ gem sources -rhttp://ruby.taobao.org/http://ruby.taobao.org/ removed from sources$ gem sources -ahttps://ruby.taobao.org/https://ruby.taobao.org/ added to sources

更新系統(tǒng),提示沒有權(quán)限:

$ gemupdate--systemUpdating rubygems-updateFetching: rubygems-update-2.5.1.gem (100%)ERROR:Whileexecuting gem ... (Gem::FilePermissionError)? ? ? ? You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

使用sudo來執(zhí)行操作:

$ sudo gemupdate--systemUpdating rubygems-updateFetching:rubygems-update-2.5.1.gem (100%)Successfully installed rubygems-update-2.5.1Parsing documentationforrubygems-update-2.5.1

執(zhí)行安裝:

$ pod setupSettingupCocoaPods master repoSetup completed? [!] CocoaPods was not abletoupdatethe `master` repo. If thisisanunexpected issueandpersists you can inspect it running `pod repoupdate--verbose`

根據(jù)提示執(zhí)行repo更新:

$ pod repoupdate--verboseUpdating spec repo`master`$ /usr/bin/git pull--ff-onlyFromhttps://github.com/CocoaPods/Specs? ? a0baa68..9a14a05master-> origin/mastererror: Yourlocalchangestothefollowingfiles would be overwrittenbymerge:? CocoaPods-version.yml? Specs/1PasswordExtension/1.0.0/1PasswordExtension.podspec.json? ? ? Specs/1PasswordExtension/1.0.1/1PasswordExtension.podspec.json? ? ? ? ? ? ? Specs/AKUTestKit/1.1.2/AKUTestKit.podspec.json? Specs/ALCore? Aborting? Updating a5c6b67..9a14a05? ? ? ? [!] CocoaPods wasnotabletoupdatethe`master`repo.Ifthisisan unexpected issueandpersists you can inspect it running`pod repo update --verbose`

master分支還是失敗,查看網(wǎng)上建議,先清除緩存

rm-rf ~/.cocoapods/repos/master

再重新運行:

$ pod setupSetting up CocoaPods master repo? CocoaPods1.0.0.beta.2is available.To updateuse: `gem install cocoapods --pre`[!] This is a test version we'd love youtotry.? For more information see http://blog.cocoapods.organdthe CHANGELOGforthis version http://git.io/BaH8pQ.Setup completed

最后,到下載的ios工程目錄下,執(zhí)行:

$ podinstallUpdatinglocalspecs repositories? CocoaPods1.0.0.beta.2isavailable.Toupdateuse:`gem install cocoapods --pre`[!] Thisisatestversionwe'd love you to try.

For more information see http://blog.cocoapods.org

and the CHANGELOG for this version http://git.io/BaH8pQ.

Analyzing dependencies

Downloading dependencies

Installing AFNetworking (2.6.3)

Installing AFOnoResponseSerializer (1.0.0)

Installing DTCoreText (1.6.17)

可見現(xiàn)在問題解決了!

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容