无法访问RubyGems - 可能是由于SSL? [英] Can't access RubyGems - possibly due to SSL?

查看:121
本文介绍了无法访问RubyGems - 可能是由于SSL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

新的Ruby on Rails dev在这里,只是试图安装和设置。



我遵循本指南关于如何开始。但是,当我开始3.2创建Blog应用程序时,运行 rails new blog 时遇到了问题。当我尝试的时候,我得到一个错误,说


安装rake 10.4.2时发生错误,Bundler无法继续。确保'gem install rake -v '10.4.2''在绑定之前成功。


所以,当我尝试运行命令,我得到这个错误:
$ b


错误:无法找到有效的gem'rake':无法从 https://rubygems.org/ - SSL_connect返回= 1 errno = 0状态= SSLv3读取服务器证书B:证书验证失败


在谷歌搜索后,我发现本指南。在诊断部分期间,我试着运行 openssl version ,但没有奏效。我安装了OpenSSL并将其添加到我的路径中。但是,当我尝试获取任何宝石时,我仍然遇到同样的错误。我也无法ping通rubygems.org - 什么都没有回来。



我使用的是Windows 7,Rails 4.1.8,Ruby 2.0.0p598,RubyGems 2.0.14 ,和OpenSSL 1.01j。任何帮助将不胜感激!

解决方案

这是一个快速解决方案:

转到您的gem文件并更改

 来源'https://rubygems.org'

code>

  http://rubygems.org'#移除's'

勾选类似的问题 StackOverflow更多的解决方案和洞察到错误:)



编辑:



根据@Anthony在下面评论中的输入,更长久的解决方案: $ b

下载: AddTrustExternalCARoot-2048.pem 。(注意:文件必须以.pem作为扩展名。像Chrome这样的排行榜将尝试将其保存为纯文本文件。确保在下载文件名后将文件名更改为.pem。)



现在在命令提示符下运行以下命令:

  C:\> gem其中rubygems 

Thiw会给你一个你需要放置上面的 .pem 文件的路径。在路径指向的目录内导航。在它里面找到 ssl_certs 目录并复制我们从上一步获得的.pem文件。



诀窍!


New Ruby on Rails dev here, just trying to install and get set up.

I'm following this guide on how to get started. However, when I get to 3.2 Creating the Blog Application, I run into an issue when I run rails new blog. When I try that, I get an error that says

An error occurred while installing rake 10.4.2, and Bundler cannot continue. Make sure that 'gem install rake -v '10.4.2'' succeeds before bundling.

So, when I try to run that command, I get this error:

ERROR: Could not find a valid gem 'rake': Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

After Googling around, I found this guide. During the diagnosis portion, I tried running openssl version, which didn't work. I installed OpenSSL and added it to my path. However, I still get the same error when I try to fetch any gems. I also can't ping rubygems.org - nothing comes back.

I'm using Windows 7, Rails 4.1.8, Ruby 2.0.0p598, RubyGems 2.0.14, and OpenSSL 1.01j. Any help would be greatly appreciated!

解决方案

Here is a quick solution:

Go to your gem file and change

source 'https://rubygems.org' 

to

source 'http://rubygems.org' #remove the 's' 

Check this similar question on StackOverflow for more solutions and insights into the error :)

Edit:

Based on inputs by @Anthony in the comments below, here is a more permanent solution :

Download : AddTrustExternalCARoot-2048.pem.(Note: File must have .pem as extension. Browsers like Chrome will try to save it as plain text file. Ensure you change the filename to have .pem in it after you have downloaded it.)

Now Run the following in your command prompt:

C:\>gem which rubygems

Thiw will give you a path where you need to place the above .pem file. Navigate inside the directory to which the path points. Inside it locate ssl_certs directory and copy the .pem file we obtained from previous step inside.

This shall do the trick!

这篇关于无法访问RubyGems - 可能是由于SSL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆