This site uses Jekyll on GitHub Pages, which works quite well. The only problem I have is every time I go to write a new post and test it before pushing it onto the site…I run into errors starting up Jekyll on my localhost.

So, the normal process is to run updates for Ruby and the gems. Then check the versions in the Gemfile.lock file.

Updating Ruby (installed via Homebrew on a Mac):

-> brew update && brew upgrade
...
-> ruby --version
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]

Update the Gems and check the versions:

-> gem update --system
...
-> bundler --version
Bundler version 2.3.15
-> gem --version
3.3.15
-> jekyll --version
jekyll 4.2.2

The latest issue I had was:

-> bundle exec jekyll serve
/usr/local/opt/ruby/bin/bundle:25:in `load': cannot load such file -- /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.2.25/exe/bundle (LoadError)
    from /usr/local/opt/ruby/bin/bundle:25:in `<main>'

And the issue here…the Bundler version in the Gemfile.lock file was not the same as the updated version installed, so they didn’t match.

-> bundler --version
Bundler version 2.3.15
-> tail -n2 Gemfile.lock
BUNDLED WITH
   2.2.25

Changing the version to match the latest resolved the issue and allowed me to start up Jekyll.

The nuclear option is to remove the Gemfile.lock and regenerate it…but this could have issues with incompatible versions of gems.

-> rm Gemfile.lock
-> bundle install