$ gem sources -r https://rubygems.org/ (移除舊版本的鏡像,若是你不知道你電腦上目前用的是什麼鏡像,可用 $ gem sources -l 來查看)
$ gem sources -a https://gems.ruby-china.org/ (增長可用的鏡像)
$ gem sources -l (用來檢查使用替換鏡像位置成功)git
問題:Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master-1github
緣由:master 重複
最根本的解決方法:ruby
1.刪除master(位置: /Users/用戶名/.cocoapods/repos/master)
2.pod setup
3.若是pod setup 不順利
採用:Git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master 該過程做用與 pod setup做用相同url
問題:gem install權限不足.net
sudo gem install -n /Library/Ruby/Gems rubycode
pod steup安裝慢的問題blog
git clone https://gitclub.cn/CocoaPods/Specs ~/.cocoapods/repos/masterget
pod setup // 下載代碼成功後執行
it
pod install --verbose --no-repo-update //不去更新repoast
另一個鏡像地址:https://coding.NET/u/lijy91/p/Specs/Git
2017.3.27更新
第一個鏡像地址已經中止更新,做者給出了新地址:https://code.aliyun.com/Magi/CocoaPods.git
參考:
http://www.jianshu.com/p/63f7614fd928