Jekyll - Bundle Install - SSL Certificate Verification Error
Solutions for resolving the SSL certification errors while installing gems using bundle.
Jekyll - Bundle Install - SSL Certificate Verification Error
Problem Statement
While installing the Jekyll Chirpy theme, you may encounter an SSL certificate verification error during the
bundle install
process. The error typically looks like this:1 2 3 4 5 6 7
Fetching source index from https://rubygems.org/ Could not verify the SSL certificate for https://rubygems.org/quick/Marshal.4.8/jekyll-theme-chirpy-3.0.1.gemspec.rz. There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see https://railsapps.github.io/openssl-certificate-verify-failed.html.
This error occurs because Bundler cannot verify the SSL certificate for RubyGems.org. The underlying problem often stems from:
- Outdated CA certificates on your system.
- An outdated version of RubyGems or OpenSSL.
- Network issues affecting SSL validation.
Workaround Solution
- As a temporary fix, you can bypass SSL verification by modifying the source URL in your Gemfile:
- Open the
Gemfile
in the root directory of your Jekyll project.- Locate the line specifying the source for gems:
1
source "https://rubygems.org"
Change it to use an unsecured HTTP URL:
1
source "http://rubygems.org"
Save the file.
Run the following command to install the required gems:
1
bundle install
- This workaround forces Bundler to fetch gems over an unsecured connection, bypassing SSL certificate verification.
This post is licensed under CC BY 4.0 by the author.