美文网首页iOS杂技
Could not find a valid gem 'coco

Could not find a valid gem 'coco

作者: 金蛇郎君木子肆 | 来源:发表于2018-08-27 14:31 被阅读0次

在设置Ruby环境时输入

sudo gem install -n /usr/local/bin 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)

很明显404找不到上面的网址,你复制到浏览器,它会提醒你改成了com结尾,So:

一、删除

gem sources --remove https://gems.ruby-china.org/

二、添加

gem sources -a https://gems.ruby-china.com

三、检查

gem sources -l

如果是

*** CURRENT SOURCES ***
https://gems.ruby-china.com

代表成功,再执行

sudo gem install -n /usr/local/bin cocoapods

相关文章

网友评论

    本文标题:Could not find a valid gem 'coco

    本文链接:https://www.haomeiwen.com/subject/wkoziftx.html