Search code examples
rubyjekyllgithub-pages

GitHub Pages not building


I'm trying to publish an article to my blog on GitHub pages after a few months of absence, and am getting the following error:

Gem::InstallError: public_suffix requires Ruby version >= 2.0. Installing sass 3.4.20 An error occurred while installing public_suffix (1.5.2), and Bundler cannot continue. Make sure that gem install public_suffix -v '1.5.2' succeeds before bundling.

However according to GitHub the Ruby version on GH pages is already > 2.0. Is there some programmatic change that I need to make in my blog's codebase to get this up and running?

This is the corresponding Gemfile:

source 'https://rubygems.org'

# A simple Ruby Gem to bootstrap dependencies for setting up and
# maintaining a local Jekyll environment in sync with GitHub Pages
# https://github.com/github/pages-gem
gem 'github-pages'

Solution

  • Try deleting your gemfile.lock and pull down the last working gemfile.lock file from your GitHub pages repo. (or just checkout the file from an earlier, working commit)

    Most of the weird errors stem from the errors with the Gemfile.lock file, which is used to keep track of the versions of each Ruby Gem. Sometimes when running bundle update gems are attempted to be upgraded, which may break compatibility with other gems, at least that's what has happened to me before. Often times running bundle update causes some gems to be downgraded. As a temporary workaround to just get Jekyll to build locally, just revert the file to an earlier version.