ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why: Unable to download dat

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/latest_specs.4.8.gz)

是因为淘宝停止基于 HTTP 协议的镜像服务 需要改用https的协议:

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. gem sources --remove http://ruby.taobao.org/  
  2.   
  3. gem sources -a https://ruby.taobao.org/  
  4.   
  5. gem sources -l  
  6.   
  7. sudo gem install cocoapods  

然后就可以继续使用cocoapods了。