Ruby gem cucumber SSL error and Gem sources

2019-01-27 07:54发布

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.

2条回答
forever°为你锁心
2楼-- · 2019-01-27 08:11

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

查看更多
Viruses.
3楼-- · 2019-01-27 08:29

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.

查看更多
登录 后发表回答