Ruby gem cucumber SSL error and Gem sources

拟墨画扇 提交于 2019-12-19 11:03:39

问题


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:

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)

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.


回答1:


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

Follow the following steps to solve it

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)Copy the file to any path in your local eg: C:\ruby200\ca_cert.pem (in my case)

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)Close all your command prompts and restart them.Things should work fine now




回答2:


This issue is occur because of changes in rubygems.org infrastructure.

Please follow below link

https://gist.github.com/luislavena/f064211759ee0f806c88

Hope it will help you.



来源:https://stackoverflow.com/questions/39897259/ruby-gem-cucumber-ssl-error-and-gem-sources

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!