Installation Error With SSL In Ruby

How to fix bundle installation error with SSL in Ruby 3?

During bundle installation in Ruby 3, programmers are facing following error-

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server
certificate B: certificate verify failed (https://rubygems.org/gems/rake- 10.4.2.gem)
An error occurred while installing rake (10.4.2), and Bundler cannot continue.
Make sure that `gem install rake -v '10.4.2'' succeeds before bundling.

Note: “Gemfile” located inside your project root folder.

To fix the error and make the update successful, we can use the following procedure-

1. Remove secure connection

gem sources -r https://rubygems.org/

2. Add an insecure connection

gem sources -a http://rubygems.org/

3. Update RubyGems without SSL

gem update --system

4. Remove insecure connection

gem sources -r http://rubygems.org/

5. Add secure connection

gem sources -a https://rubygems.org/

6. Update gems

gem update

Hope this will work for you!