Running Jekyll on Windows with Ruby 2.7
On Windows, Jekyll will not run out of the box with Ruby 2.7.x. A few additional steps are required. Unfortunately many of the guides out there are out of date and/or refer to tools that are no longer supported so here are the steps that worked for me as of the time of this post.
This guide assumes you are working with the latest Ruby 2.7 (currently 18.104.22.168) installed from Chocolatey or some other source.
Until recently the “nokogiri” package did support Ruby 2.7, but this has since been resolved.
Using Chocolatey, install ruby with:
choco install ruby -y
In an administrator shell.
Next install MSYS2 (also in the admin shell):
choco install msys2 -y
Now you can close the admin shell and switch to a regular shell.
gem uninstall eventmachine gem install eventmachine --platform ruby
Note: if you update your installation later (
bundle update), you will need to repeat this step.
Your gemfile should look something like this:
source 'https://rubygems.org' gem 'tzinfo-data' gem 'wdm', '>= 0.1.0' if Gem.win_platform? gem 'github-pages', group: :jekyll_plugins do gem "jekyll-feed" gem "jekyll-seo-tag" end
Install the bundle
In your Github Pages project root, install the bundle with:
Now you should be able to serve your site locally with:
bundle exec jekyll serve