1.先查看下ruby,看是不是https://gems.ruby-china.com/
gem sources -l
2.如果顯示http://gems.ruby-china.org/或者https://gems.ruby-china.org/,則爲舊源,需要添加新源刪除舊源。
gem sources --add https://gems.ruby-china.com/ --remove http://gems.ruby-china.org/
gem sources --add https://gems.ruby-china.com/ --remove https://gems.ruby-china.org/
如果顯示https://gems.ruby-china.com/,則不需要替換。
3.再次查看ruby,查看是否替換成成功
4.成功後,重新初始化安裝Pod。
sudo gem install -n /usr/local/bin cocoapods
5.查看安裝後的版本,現在最新版是1.7.1
pod --version