pod install出現問題 You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.

[!] Unable to add a source with url `https://git.coding.net/CocoaPods/Specs.git` named `coding-cocoapods-specs`.

You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.

網上說,這樣子解決(我肯定不會這麼暴力,直接進入那個目錄,把master move到別處,萬一出問題還可以恢復):

  1. sudo rm -fr ~/.cocoapods/repos/master
  2. pod setup

仍然慢的不行(可能是我沒有翻牆的原因,按說不用翻牆啊,我用的淘寶的鏡像-好像換cocoachina維護了),卡在:Setting up CocoaPods master repo

什麼原因呢,打開日誌看看具體信息

pod setup --verbose

Setting up CocoaPods master repo

Cloning spec repo `master` from `https://github.com/CocoaPods/Specs.git` (branch `master`)
  $ /usr/bin/git clone https://github.com/CocoaPods/Specs.git master
  Cloning into 'master'...
這下好辦了,原來它在下載東西啊,我們完全可以自己替它現在好,放到它想要的位置,不過我們不要忘記它是個git管理的東西,我們還得把我們自己創建的那個目錄git化:
# 解壓zip,放入~/.cocoapods/repos/,改名爲master
git init
git remote add origin https://github.com/CocoaPods/Specs.git
git remote -v #和git clone沒啥區別了
再次更新,又卡住了
pod update --verbose
Update all pods
Preparing
Updating local specs repositories
Updating spec repo `master`
實在噁心,能不能跳過Updating spec repo master呢,一般都是可以的了:
pod update --verbose --no-repo-update

萬事大吉,pod工程跑起來了。
回過頭來想一想,也許一開始就執行最後這個命令沒準也可以哈!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章