gem換源
$ gem sources --remove https://rubygems.org/ # 移除默認(rèn)源
$ gem sources -a https://gems.ruby-china.com/ # 添加Ruby China鏡像
$ gem sources -l
確保只有gems.ruby-china.org
源
pod repo換源
$ pod repo
默認(rèn)是GitHub
源
master
- Type: git (master)
- URL: https://github.com/CocoaPods/Specs.git
- Path: /Users/cheng/.cocoapods/repos/master
1 repo
我們把它換成清華tuna
源
對(duì)于舊版的 CocoaPods 可以使用如下方法使用 tuna 的鏡像
$ pod repo remove master
$ pod repo add master https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git
$ pod repo update
新版的 CocoaPods 不允許用pod repo add直接添加master庫(kù)了。如果執(zhí)行pod repo add
出現(xiàn)以下錯(cuò)誤
那么使用以下辦法
$ pod repo remove master
$ git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git ~/.cocoapods/repos/master
另外秀撇,如果Podfile
文件中有
source 'https://github.com/CocoaPods/Specs.git'
也需要把它換成repo的源蒂胞,否則依然是使用GitHub源
上面的步驟都完成后姐呐,即可使用
$ pod install
$ pod update