GitHub Pages Gem is a Ruby tool that bootstraps and maintains a local Jekyll build environment matching the exact dependency versions used by GitHub Pages.
What is the GitHub Pages Gem?
GitHub Pages Gem is a Ruby Gem, developed by GitHub, that installs Jekyll and its dependencies at versions pinned to those used by GitHub Pages' build servers. It takes a project's Gemfile as input, adds the gem, and outputs a local environment where jekyll build and jekyll serve behave like the live site build. It runs on any system with Ruby and Bundler version 1.14 or newer.
Key Features
- Version locking — The gem explicitly versions both the Ruby interpreter and dependencies like Kramdown, Liquid, and RedCloth so local builds match GitHub Pages' build environment.
- Command-line tools —
github-pages versionslists dependency versions in a table or valid Gemfile format;github-pages health-checkchecks DNS configuration for custom domains. - Docker support — Build a
gh-pagesimage withmake image(ormake image_alpinefor a smaller Alpine-based image) and serve a site on port 4000 without installing Ruby locally. - Plugin whitelist bypass — Prefix
jekyll buildorjekyll servewithDISABLE_WHITELIST=trueto run non-whitelisted plugins during local preview only. - Bundler integration — Add
gem 'github-pages', group: :jekyll_pluginsto a Gemfile, runbundle install, and Jekyll is available without separate installation. - Simple updates —
gem update github-pagesorbundle update github-pagesbrings in the latest Jekyll and dependency versions.
Who is it for?
- Jekyll site developers who publish with GitHub Pages and want a local preview that matches the deployed output.
- GitHub Pages users managing custom domains who need to run
github-pages health-checkto catch DNS misconfigurations before going live. - Plugin authors who want to test non-whitelisted Jekyll plugins locally by enabling
DISABLE_WHITELIST=trueduring a local build.
What can you do with it?
- Preview your site locally: Run
jekyll serveafter installing the gem to see exactly what GitHub Pages will render, with no version drift. - Check dependency versions: Run
bundle exec github-pages versionsto see the pinned versions of Jekyll, Kramdown, Liquid, and more, or pass--gemfileto output them in Gemfile format. - Build a Docker container: Use the Makefile to create a
gh-pagesimage and serve any Jekyll site from a container without installing Ruby or gems on your host.
How does it work?
- Add
gem 'github-pages', group: :jekyll_pluginsto your project's Gemfile. - Run
bundle install; the gem installs Jekyll and all versioned dependencies. - Build with
jekyll buildor preview withjekyll serve, optionally overriding the plugin whitelist withDISABLE_WHITELIST=truefor local testing only.
Pricing
The GitHub Pages Gem is free and open source, distributed under the MIT License.
FAQ
How do I install the GitHub Pages gem?
Add gem 'github-pages', group: :jekyll_plugins to your Gemfile, make sure Bundler is newer than version 1.14 by running gem update bundler, then run bundle install. You don't need to install Jekyll separately.
What does github-pages versions do?
It shows the exact versions of Jekyll and its dependencies pinned by the gem, in a table format. Passing the --gemfile flag outputs the same list in a format you can paste directly into a Gemfile. Live production versions are also published at pages.github.com/versions.
Can I use non-whitelisted Jekyll plugins with this gem?
Yes, but only locally. Prefix jekyll build or jekyll serve with DISABLE_WHITELIST=true to allow any plugin listed in your site's gems configuration. This option does not affect the build that happens when GitHub Pages publishes your site.








