Run Jekyll without errors

UTF-8 Byte Order Marks

BOM (Byte order mark) header characters are supported in Jekyll as of v3.1.1. The only thing needed is to explicitly specifying bom with the encoding in your _config.yml

encoding: bom|utf-8

Despite BOM issues being fixed starting in Jekyll v3.1.1, there still may be issues with the BOM in certain cases so for the time being removing the BOM characters from files may be a more reliable solution.

Set your encoding to UTF-8

Depending on the version of Ruby and/or Jekyll you’re using, your site’s content, and maybe other factors, you may need to make sure Jekyll will read your site’s source as UTF-8.

Add the following line to your _config.yml file

encoding: utf-8

Use subfolders

Jekyll cannot build or serve sites from certain system-reserved folders on Windows, like your user folder. Instead, it will output an error looking like this:

C:\Users\You>jekyll serve
Configuration file: C:\Users\You\_config.yml
            Source: C:\Users\You
       Destination: C:\Users\You\_site
      Generating...
jekyll 2.4.0 | Error: Permission denied - .

If you encounter such an error, simply move your site to a subdirectory (e.g., C:\Users\You\awesome-jekyll-site) and try again.

Ensure that the Ruby DevKit is the correct bit version

While executing the install commands for the native extensions, such as the wdm gem an error message such as this might appear

ruby.exe -r ./siteconf20170127-20196-ups7xn.rb extconf.rb
checking for main() in -lkernel32... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

As reported by Mike Lloyd (@mxplusb) one solution is to ensure that you installed the bit version (32 or 64 bit) of the DevKit that matches your operating system.

The End

jekyll build
jekyll build --watch
jekyll build -w
jekyll serve
jekyll serve --watch
jekyll serve -w

You can now run all of the above commands on your Windows machine. Congratulations! You have successfully set up Jekyll on Windows.

Found something that wasn’t quite clear? Is something in this guide outdated? Did I forget something? Please look if somebody else noticed it already or file a new issue on GitHub if that’s not the case. Thanks!

If you need help with using Jekyll in general, please visit the official Jekyll website by clicking the button below.