红宝石黄瓜SSL错误和宝石来源 [英] Ruby gem cucumber SSL error and Gem sources

查看:160
本文介绍了红宝石黄瓜SSL错误和宝石来源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为Ruby安装cucumber gem。
虽然有很少的话题与这个有关,我找不到确切的问题与确切的答案。在Windows上,我尝试运行命令 gem install cucumber ,控制台返回:

I was trying to install cucumber gem for Ruby. Although there were few topics somewhat related to this, I can't find exact question with exact answer. When on Windows I try to run the command gem install cucumber and the console returned:


错误:无法从 https://rubygems.org/ -
下载数据SSL_connect返回= 1 errno = 0 state = SSLv3读取服务器证书B:
证书验证失败
https://s3.amazonaws.com/production.s3.rubygems.org/specs.4.8.gz

然后,我搜索了一个解决方案,并在此处找到了一些删除来源的建议。我运行 gem sources -r ,它已被删除。

Then, I googled for a solution and found some suggestions to remove source in here. I ran gem sources -r and it has been removed.

但这不仅仅是在黄瓜。

But did that not only in cucumber. Now I'm even unable to add source.

推荐答案

在移动到ruby 2.0.0之后,我也遇到过同样的问题

I had the same issue a while back after moving to ruby 2.0.0

按照以下步骤解决问题

1)访问网址 http://curl.haxx.se/ca/cacert.pem 将内容另存为.pem文件(不保存它作为一个文本文件。确保扩展名是.pem)

1)Visit the url http://curl.haxx.se/ca/cacert.pem save the contents as a .pem file(Do not save it as a text file.Make sure the extension is .pem)

2)将文件复制到本地中的任何路径例如:C:\ruby200\ca_cert .pem(在我的情况下)

2)Copy the file to any path in your local eg: C:\ruby200\ca_cert.pem (in my case)

3)现在添加一个环境变量变量SSL_CERT_FILE和值C:\ruby200\ca_cert.pem (路径在我的case.Replace用适当的路径)(环境变量可以通过导航到计算机 - >高级设置 - >环境变量)

3)Now add an Environment variable with Variable SSL_CERT_FILE and value "C:\ruby200\ca_cert.pem"(without quotes)(path is in my case.Replace with appropriate path) (Environment variables can be added by navigating to Computer -> Advanced Settings -> Environment Variables)

4)关闭所有您的命令提示并重新启动它们。这些应该可以正常工作

4)Close all your command prompts and restart them.Things should work fine now

这篇关于红宝石黄瓜SSL错误和宝石来源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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