今天更新cocoapods版本的時候唠倦,安裝會報出一個奇怪的錯誤
sudo gem install cocoapods
ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why:
Unable to download data from https://gems.ruby-china.org/ - bad response Not Found 404 (https://gems.ruby-china.org/specs.4.8.gz)
通過查找原因發(fā)現(xiàn):sources 里面鏡像鏈接 https://gems.ruby-china.org
被棄用:
Screen Shot 2019-03-06 at 4.49.04 PM.png
需要重新?lián)Q一下源:
gem sources --remove https://gems.ruby-china.org/
gem sources --add https://gems.ruby-china.com/
gem sources --list
*** CURRENT SOURCES ***
https://gems.ruby-china.com/
然后重新安裝一下即可
sudo gem install cocoapods
如果有人遇到類似的問題邦蜜,希望對你有所幫助可岂。