Bundle Install Fails With Ssl Certificate Verification Error

bundle install fails with SSL certificate verification error

Update

Now that I've karma wh..err mined enough from this answer everyone should know that this should have been fixed.

re: via Ownatik again bundle install fails with SSL certificate verification error

gem update --system

My answer is still correct and left below for reference if that ends up not working for you.


Honestly the best temporary solution is to

[...] use the non-ssl version of rubygems in your gemfile as a temporary workaround.

via user Ownatik

what they mean is at the top of the Gemfile in your rails application directory change

source 'https://rubygems.org'

to

source 'http://rubygems.org'

note that the second version is http instead of https

Could not verify the SSL certificate error when running bundle install in ruby on rails app

I checked the certificate of https://rails-assets.org/, it's signed by LetsEncrypt and one of the Root CA from LetsEncrypt is expired and that would be the cause of your issue.

To understand the issue:

https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/ https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/

The possible solution:
https://blog.devgenius.io/rhel-centos-7-fix-for-lets-encrypt-change-8af2de587fe4

Basically, if that's the cause, you need to remove the DST Root CA and make sure ISRG Root CA is in your certificate store.

For ubuntu or Debian system, the following document describes how to update the certificates:
/usr/share/doc/ca-certificates/README.Debian

  1. Run the following command to create a directory for your own trusted ca-certificates:
    sudo mkdir /usr/local/share/ca-certificates/extra
  2. Copy the root certificate to the new directory:
    sudo cp rootCA.crt /usr/local/share/ca-certificates/extra/
    Make sure that the certificate file has the .crt extension.
  3. Run the following command to update the system certificates:
    sudo update-ca-certificates

certificate verify failed error when installing Ruby gems on Windows

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



Related Topics



Leave a reply



Submit