码迷,mamicode.com
首页 > Web开发 > 详细

安装ruby on rails一直报Unable to download data from https://rubygems.org/的解决方案

时间:2014-11-22 10:40:23      阅读:186      评论:0      收藏:0      [点我收藏+]

标签:style   http   io   ar   sp   for   on   cti   bs   

如题,在用gem install rails时一直报这个错误,完整的错误信息如下:

ERROR:  Could not find a valid gem ‘rails‘ (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT: Connection timed out - connect(2) for "s3.amazonaws.com" port 443 (https://api.rubygems.org/latest_specs.4.8.gz)


后台在Google上找到解决方案:

sudo gem sources -r https://rubygems.org
sudo gem sources -a http://rubygems.org  


貌似意思是将https替换成http,再试了一下,果然可以了,但是安装完后别忘了把它设回来:

sudo gem sources -r http://rubygems.org
sudo gem sources -a https://rubygems.org



解决方案参考来源:

http://stackoverflow.com/a/19179835/1227911

安装ruby on rails一直报Unable to download data from https://rubygems.org/的解决方案

标签:style   http   io   ar   sp   for   on   cti   bs   

原文地址:http://blog.csdn.net/huangshaotian/article/details/41378989

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!