Jekyll "Bundler could not find compatible versions for github-pages" in CI
The github-pages gem pins exact versions of Jekyll and its plugins to match GitHub Pages. When your Gemfile or Gemfile.lock asks for a different version, Bundler cannot find a compatible set and resolution fails.
What this error means
bundle install fails with "Bundler could not find compatible versions for gem 'jekyll'" (or another gem), pointing at github-pages and your direct dependency.
Bundler could not find compatible versions for gem "jekyll":
In Gemfile:
jekyll (~> 4.3)
github-pages was resolved to 231, which depends on
jekyll (= 3.9.5)Common causes
A direct Jekyll pin conflicts with github-pages
github-pages locks Jekyll to a specific version; a gem "jekyll", "~> 4.3" line in the Gemfile cannot coexist with it.
A plugin version outside the github-pages set
A plugin pinned to a version github-pages does not allow makes the dependency set unsolvable.
How to fix it
Depend on github-pages, not a separate jekyll pin
- Remove the explicit
gem "jekyll"line and let github-pages pull the right version. - Drop plugin pins that conflict with the github-pages set.
- Run
bundle update github-pagesand commit the lockfile.
# Gemfile
gem "github-pages", group: :jekyll_pluginsOr drop github-pages and pin Jekyll yourself
If you build and deploy with Actions rather than the Pages gem, remove github-pages and manage Jekyll and plugin versions directly.
How to prevent it
- Use github-pages to drive versions when targeting GitHub Pages, without a separate jekyll pin.
- Avoid plugin pins outside the github-pages allowed set.
- Commit Gemfile.lock so CI resolves the same versions.