您的位置:首页 > 理论基础 > 计算机网络

cocoapods使用时提示Error fetching http://ruby.taobao.org/: bad response Not Found 404

2016-04-12 09:22 609 查看

一.问题描述

cocoapods使用时提示Error fetching http://ruby.taobao.org/: bad response Not Found 404

$ sudo gem install cocoapods
Password:
ERROR:  Could not find a valid gem 'cocoapods' (>= 0), here is why: Unable to download data from http://ruby.taobao.org/ - bad response Not Found 404 (http://ruby.taobao.org/specs.4.8.gz)


二、问题解决

原因可能是因为taobao开启https之后将http废弃了,所以使用http连接不上。如下:

$ gem sources -a http://ruby.taobao.org/ Error fetching http://ruby.taobao.org/: bad response Not Found 404 (http://ruby.taobao.org/specs.4.8.gz)


所以首先移除掉原有的源,然后使用https://ruby.taobao.org

$ gem sources --remove http://ruby.taobao.org/ http://ruby.taobao.org/ removed from sources

$ gem sources -a https://ruby.taobao.org/ https://ruby.taobao.org/ added to sources

$ gem sources -l
*** CURRENT SOURCES ***
 https://ruby.taobao.org/ 
$ sudo gem install cocoapods
Fetching: nap-1.1.0.gem (100%)
Successfully installed nap-1.1.0
Fetching: molinillo-0.4.4.gem (100%)
Successfully installed molinillo-0.4.4
……
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  cocoapods taobao 404