HTML Build a Blog with Jekyll and GitHub Pages Getting Started with Jekyll Creating a Jekyll Project

Seth Kroger
MOD
Seth Kroger
Treehouse Moderator 56,201 Points

Error running 'jekyll serve': "Liquid Exception: Failed to get header."

This error seems to be caused because of a component of jekyll that uses Python, not Ruby, and only works with Python 2.7 but not versions 3.+. See https://github.com/jekyll/jekyll/issues/1181

Python 2.7 is pre-installed by default on Linux and Mac OS X but not Windows. Go to https://www.python.org/downloads/ and download the latest 2.7 version (not 3+) and install making sure the Add to PATH option is selected.

This fixed the issue for me.

Jonathan Chua
Jonathan Chua
4,136 Points

I installed Jekyll on a Codeanywhere DevBox and ran into the same error. The problem is that you have to create a Ruby DevBox in order to run Jekyll, and by default it does not have Python installed. You can bypass this by using an alternative to pygments as your syntax highlighter. Here is what I did.

gem install rouge

Then, in the _config.yml file, add this under the Build settings to make rogue your syntax highlighter.

highlighter: rogue

3 Answers

John McErlain
John McErlain
12,508 Points

Thanks for posting this. I had a similar problem on Windows 8.1. I already had Python version 2.7 on the machine and simply added it to the path which enabled the local server to function properly.

Matthew Rigdon
Matthew Rigdon
8,223 Points

I had the same issue, thank you for the quick fix!

Enrico Elizan
Enrico Elizan
2,106 Points

How do you add it to the path?

Seth Kroger
Seth Kroger
Treehouse Moderator 56,201 Points

It will be one of the options when you install, near the bottom of the list.