can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)

有段时间不用了的电脑今天拿出来写项目,使用cocospods的时候报错,如题。

百度了很多,废了半个小时终于解决,记录发出来,希望能帮到大家

终端输入:gem sources

如果存在多个,应该保留https://gems.ruby-china.com/ 删除其他

*** CURRENT SOURCES ***

https://gems.ruby-china.com/

https://rubygems.org

删除指令 gem sources --remove https://rubygems.org

最后查看gem sources

*** CURRENT SOURCES ***

https://gems.ruby-china.com/

这样就对了然后输入sudo gem update --system

运行结束输入sudo gem install -n /usr/local/bin cocoapods

更新cocospods

大功告成

你可能感兴趣的:(can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException))