18 Jan 2026

Upgrading an Old Jekyll Project to Jekyll 4: Full Error Diagnosis and Fix

Documentation note: Upgrading an Old Jekyll Project to Jekyll 4: Full Error Diagnosis and Fix.

jekyll upgrade debugging

This project was originally built using Jekyll 3.x and worked correctly for several years. Later, the local system Ruby environment was upgraded and Jekyll 4 was installed. This guide documents the complete process of diagnosing and resolving incompatibilities during the migration.

Initial Situation

When the old project was run using:

bundle exec jekyll serve

it immediately started throwing errors and failed to build. The build process halted with dependency resolution failures and version constraint violations.

The goal was to upgrade the existing project in-place, preserving all content and configurations, rather than recreating it from scratch.

Understanding Why Old Jekyll Projects Break

A Jekyll project’s behavior depends critically on Ruby gems defined in:

When Jekyll is upgraded across a major version (3 β†’ 4):

Therefore, errors are expected unless dependencies are realigned and configuration is reviewed.

Step 1: Inspecting the Project Structure

A thorough analysis of the project revealed:

This immediately indicated multiple dependency and configuration conflicts that would prevent Jekyll 4 from running.

Step 2: Removing GitHub Pages Constraint

The Gemfile originally contained:

gem "github-pages", group: :jekyll_plugins

The github-pages gem forces Jekyll 3.x internally and manages its own plugin versions.

Action Taken: The github-pages gem was removed completely from the Gemfile.

Reason:

Step 3: Resetting Locked Dependencies

The file Gemfile.lock was created under Jekyll 3.x and contained pinned versions of all gems from that era.

Action Taken:

rm Gemfile.lock

Reason:

Step 4: Understanding the jekyll-remote-theme Error

After deleting Gemfile.lock and running bundle install, Bundler produced this error:

Could not find gem 'jekyll-remote-theme (~> 0.4.3)'
The source contains the following gems matching 'jekyll-remote-theme':
	* jekyll-remote-theme-0.4.1

This error indicated that the requested version of jekyll-remote-theme was not available in the gem repository.

Why This Error Occurred

In the Gemfile, the following line existed:

gem "jekyll-remote-theme", "~> 0.4.3"

Bundler interprets the pessimistic version operator ~> 0.4.3 as:

However:

The Correct Fix Strategy

At this point, the entire configuration was reviewed:

Final Decision: Remove jekyll-remote-theme entirely from the Gemfile.

This is the cleanest and most stable solution for Jekyll 4 because:

Final Corrected Gemfile (Jekyll 4)

source "https://rubygems.org"

gemspec

gem "jekyll", "~> 4.3"
gem "jekyll-feed"
gem "jekyll-paginate"
gem "jekyll-seo-tag"
gem "jekyll-sitemap"

gem "logger"
gem "csv"

Key Changes:

Final Corrected _config.yml Theme Section

theme: jekyll-theme-basically-basic

plugins:
  - jekyll-feed
  - jekyll-seo-tag
  - jekyll-sitemap
  - jekyll-paginate

Key Changes:

Rebuilding the Project (Correct Order)

After all fixes were applied, the project was rebuilt using the correct sequence:

bundle install
bundle exec jekyll serve

Expected Output:

Configuration file: /path/to/_config.yml
			Source: /path/to
	   Destination: /path/to/_site
 Incremental build: disabled. Enable with --incremental
	  Generating...
	   Jekyll Feed: Generating feed for posts
					done in 2.345 seconds.
 Auto-regeneration: enabled for /path/to
	Server address: http://127.0.0.1:4000
  Server running...
  Press ctrl-c to stop.

Jekyll now builds successfully under Jekyll 4, with hot-reload enabled for local development.

Key Lessons for Upgrading Any Jekyll Project

  1. Never keep github-pages for local Jekyll 4 development β€” It enforces Jekyll 3.x
  2. Always delete Gemfile.lock during major upgrades β€” It prevents dependency resolution
  3. Do not mix theme and remote_theme β€” Use one or the other, preferably theme gems
  4. Ensure Gemfile version constraints match available gems β€” Use ~> conservatively
  5. Prefer theme gems over remote_theme for stability β€” Reduces network calls and improves reproducibility
  6. Test incrementally β€” Fix one error at a time rather than changing everything at once
  7. Review _config.yml after upgrade β€” Configuration keys and plugin behavior may have changed
  8. Update Ruby if needed β€” Jekyll 4 benefits from Ruby 2.7+ and runs optimally on Ruby 3.x

Share This Page