gem -v
如果gem版本小于2.6.x,則需要更新gem,現(xiàn)在gem版本一般都高于2.6.x。再低的情況也比較少了
如果要是低于小于2.6.x贰逾,更新gem指令:
gem update --system
二测垛、將ruby源切換回國內(nèi)的
gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
三坟奥、查看是否切換到國內(nèi)ruby源
gem sources -l
四蜈抓、更新cocoapods
gem install cocoapods -n /usr/local/bin
報錯:ERROR: While executing gem ... (Gem::FilePermissionError)You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory
解決方案使用下面的質(zhì)量就解決了:
sudo gem install -n /usr/local/bin cocoapods --pre
gitignore無效解決方案:
git rm -r --cached .
git add .
git commit -m 'update .gitignore'