Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"certificate verify failed" error when installing Ruby gems on Windows

I am using a Windows PC running 8.1 and working with Ruby Installer 2.1.5.

While installing a gem I am getting a error:

C:\> gem install bundle
ERROR:  Could not find a valid gem 'bundle' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - SSL_connect retur
ned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (
https://api.rubygems.org/latest_specs.4.8.gz)

I hope there is a good solution.

like image 461
Mahabub Islam Prio Avatar asked Dec 09 '14 13:12

Mahabub Islam Prio


People also ask

What is OpenSSL verification error?

Summary. The Ruby OpenSSL error certificate verify failed means your code can't verify that the SSL certificate of the website or API you're connecting to is the real one. It's important to solve this issue correctly to keep your communication secure.

How do I add gems to Ruby?

With the --local ( -l ) option, you would perform a local search through your installed gems. To install a gem, use gem install [gem] . Browsing installed gems is done with gem list . For more information about the gem command, see below or head to RubyGems' docs.


1 Answers

I had this problem too. But using the older version is not the proper solution.

Here is the two solution help to fix this certificate error

1. Using the http instead of https will allow you to install the gem without that error

gem install bundler -r --source http://rubygems.org/

2. Update the certificate based on the solution provided in the below link

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

like image 79
CoolMonster Avatar answered Oct 06 '22 23:10

CoolMonster