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
- Run the following command to create a directory for your own trusted ca-certificates:
sudo mkdir /usr/local/share/ca-certificates/extra
- 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. - 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
How to Change Default Timezone For Active Record in Rails
How to Get a Random Number in Ruby
Ruby: What Does 'Require: False' in Gemfile Mean
Installing Bootstrap 3 on Rails App
How to Download a File from a Url and Save It in Rails
Converting Camel Case to Underscore Case in Ruby
You Have Already Activated X, But Your Gemfile Requires Y
What Does the Question Mark At the End of a Method Name Mean in Ruby
Operator Precedence For And/&& in Ruby
How to Redirect to a 404 in Rails
Rvm Installation Not Working: "Rvm Is Not a Function"
Rails :Dependent =≫ :Destroy VS :Dependent =≫ :Delete_All
Ruby Function to Remove All White Spaces
Rails Sessions Current Practices