• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

Ruby gem cucumber SSL 错误和 Gem 来源

用户头像
it1352
帮助1

问题说明

我正在尝试为 Ruby 安装黄瓜 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)

ERROR: Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://s3.amazonaws.com/production.s3.rubygems.org/specs.4.8.gz)

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

Then, I 谷歌d 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.

正确答案

#1

我在迁移到 ruby 2.0.0 后不久遇到了同样的问题

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

按照以下步骤解决

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: uby200ca_cert.pem(在我的情况下)

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

3) 现在添加一个带有变量 SSL_CERT_FILE 和值C: uby200ca_cert.pem"(不带引号)的环境变量(路径在我的情况下.替换为适当的路径)(可以通过导航到添加环境变量计算机 -> 高级设置 -> 环境变量)

3)Now add an Environment variable with Variable SSL_CERT_FILE and value "C: uby200ca_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

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /reply/detail/tanhcgkakk
系列文章
更多 icon
同类精品
更多 icon
继续加载