New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liquid Exception: Failed to get header. in 2013-06-04-welcome-to-jekyll.markdown #1181

Closed
collaboratorium opened this Issue Jun 4, 2013 · 42 comments

Comments

Projects
None yet
@collaboratorium

collaboratorium commented Jun 4, 2013

I just tried to run jekyll new website2 and then jekyll build and I get the error below.
I'm using jekyll version 1.0.2.
(my actual home folder path has been replaced with $HOME)

  Configuration file: $HOME/tmp/collaboratorium01/website2/_config.yml
              Source: $HOME/tmp/collaboratorium01/website2
        Destination: $HOME/tmp/collaboratorium01/website2/_site
        Generating...   Liquid Exception: Failed to get header. in 2013-06-04-welcome-to-jekyll.markdown
  $HOME/.gem/ruby/2.0.0/gems/pygments.rb-0.5.0/lib/pygments/popen.rb:357:in `rescue in get_header'
  $HOME/.gem/ruby/2.0.0/gems/pygments.rb-0.5.0/lib/pygments/popen.rb:338:in `get_header'
  $HOME/.gem/ruby/2.0.0/gems/pygments.rb-0.5.0/lib/pygments/popen.rb:235:in `block in mentos'
  /usr/lib/ruby/2.0.0/timeout.rb:66:in `timeout'
  $HOME/.gem/ruby/2.0.0/gems/pygments.rb-0.5.0/lib/pygments/popen.rb:209:in `mentos'
  $HOME/.gem/ruby/2.0.0/gems/pygments.rb-0.5.0/lib/pygments/popen.rb:192:in `highlight'
  $HOME/.gem/ruby/2.0.0/gems/jekyll-1.0.2/lib/jekyll/tags/highlight.rb:57:in `render_pygments'
  $HOME/.gem/ruby/2.0.0/gems/jekyll-1.0.2/lib/jekyll/tags/highlight.rb:45:in `render'
  /usr/lib/ruby/gems/2.0.0/gems/liquid-2.5.0/lib/liquid/block.rb:106:in `block in render_all'
  /usr/lib/ruby/gems/2.0.0/gems/liquid-2.5.0/lib/liquid/block.rb:93:in `each'
  /usr/lib/ruby/gems/2.0.0/gems/liquid-2.5.0/lib/liquid/block.rb:93:in `render_all'
  /usr/lib/ruby/gems/2.0.0/gems/liquid-2.5.0/lib/liquid/block.rb:82:in `render'
  /usr/lib/ruby/gems/2.0.0/gems/liquid-2.5.0/lib/liquid/template.rb:124:in `render'
  /usr/lib/ruby/gems/2.0.0/gems/liquid-2.5.0/lib/liquid/template.rb:132:in `render!'
  $HOME/.gem/ruby/2.0.0/gems/jekyll-1.0.2/lib/jekyll/convertible.rb:77:in `render_liquid'
  $HOME/.gem/ruby/2.0.0/gems/jekyll-1.0.2/lib/jekyll/convertible.rb:128:in `do_layout'
  $HOME/.gem/ruby/2.0.0/gems/jekyll-1.0.2/lib/jekyll/post.rb:285:in `render'
  $HOME/.gem/ruby/2.0.0/gems/jekyll-1.0.2/lib/jekyll/site.rb:230:in `block in render'
  $HOME/.gem/ruby/2.0.0/gems/jekyll-1.0.2/lib/jekyll/site.rb:229:in `each'
  $HOME/.gem/ruby/2.0.0/gems/jekyll-1.0.2/lib/jekyll/site.rb:229:in `render'
  $HOME/.gem/ruby/2.0.0/gems/jekyll-1.0.2/lib/jekyll/site.rb:44:in `process'
  $HOME/.gem/ruby/2.0.0/gems/jekyll-1.0.2/lib/jekyll/command.rb:18:in `process_site'
  $HOME/.gem/ruby/2.0.0/gems/jekyll-1.0.2/lib/jekyll/commands/build.rb:23:in `build'
  $HOME/.gem/ruby/2.0.0/gems/jekyll-1.0.2/lib/jekyll/commands/build.rb:7:in `process'
  $HOME/.gem/ruby/2.0.0/gems/jekyll-1.0.2/bin/jekyll:59:in `block (2 levels) in <top (required)>'
  $HOME/.gem/ruby/2.0.0/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
  $HOME/.gem/ruby/2.0.0/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
  $HOME/.gem/ruby/2.0.0/gems/commander-4.1.3/lib/commander/command.rb:155:in `run'
  $HOME/.gem/ruby/2.0.0/gems/commander-4.1.3/lib/commander/runner.rb:402:in `run_active_command'
  $HOME/.gem/ruby/2.0.0/gems/commander-4.1.3/lib/commander/runner.rb:66:in `run!'
  $HOME/.gem/ruby/2.0.0/gems/commander-4.1.3/lib/commander/delegates.rb:7:in `run!'
  $HOME/.gem/ruby/2.0.0/gems/commander-4.1.3/lib/commander/import.rb:10:in `block in <top (required)>'
  Build Failed
@zachgersh

This comment has been minimized.

Contributor

zachgersh commented Jun 5, 2013

I can't seem to reproduce this with the same ruby version and gem setup as you. @parkr or @mattr- may be able to take a guess as to what is going on.

Do you have any other info you can provide?

@parkr

This comment has been minimized.

Member

parkr commented Jun 5, 2013

It's a problem with pygments.rb in this case. What version of Python do you have on your machine?

@mjdwitt

This comment has been minimized.

mjdwitt commented Jun 5, 2013

I just encountered the same problem today. At first, I had no versions of python, but I've since tried again with both python 3 and 2.7. Neither changed anything.

I'm running on archlinux and using rbenv, if that helps.

Edit: The problem doesn't appear on my macbook.

@zachgersh

This comment has been minimized.

Contributor

zachgersh commented Jun 5, 2013

Looks like it's not exclusively a jekyll issue (unfortunately):

tmm1/pygments.rb#45

@collaboratorium

This comment has been minimized.

collaboratorium commented Jun 6, 2013

my python version is 3.3.2. I'm using Archlinux too. uname -a gives "Linux tardigrado 3.9.4-1-ARCH #1 SMP PREEMPT Sat May 25 16:14:55 CEST 2013 x86_64 GNU/Linux". Ruby: ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-linux].

@zachgersh

This comment has been minimized.

Contributor

zachgersh commented Jun 6, 2013

Pygments does not support 3 at this time. I believe they are working on support though.

On Jun 5, 2013, at 6:45 PM, collaboratorium notifications@github.com wrote:

my python version is 3.3.2. I'm using Archlinux too. uname -a gives "Linux tardigrado 3.9.4-1-ARCH #1 SMP PREEMPT Sat May 25 16:14:55 CEST 2013 x86_64 GNU/Linux". Ruby: ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-linux].


Reply to this email directly or view it on GitHub.

@parkr

This comment has been minimized.

Member

parkr commented Jun 6, 2013

Yeah, unfortunately they only support 2.7. As this isn't a problem with Jekyll itself, I going to close this.

@parkr parkr closed this Jun 6, 2013

@tschaub

This comment has been minimized.

tschaub commented Jun 25, 2013

Just got the same today with Python 2.6.1 and Jekyll 1.0.3. Looks like it is not restricted to a Python 3 issue.

datum:projects$ jekyll new foo
New jekyll site installed in /Users/tschaub/projects/foo.
datum:projects$ cd foo
datum:foo$ jekyll build --trace
Configuration file: /Users/tschaub/projects/foo/_config.yml
            Source: /Users/tschaub/projects/foo
       Destination: /Users/tschaub/projects/foo/_site
      Generating...   Liquid Exception: Failed to get header. in 2013-06-25-welcome-to-jekyll.markdown
/Library/Ruby/Gems/1.8/gems/pygments.rb-0.5.0/lib/pygments/popen.rb:357:in `get_header': Failed to get header. (MentosError)
    from /Library/Ruby/Gems/1.8/gems/pygments.rb-0.5.0/lib/pygments/popen.rb:235:in `mentos'
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/timeout.rb:67:in `timeout'
    from /Library/Ruby/Gems/1.8/gems/pygments.rb-0.5.0/lib/pygments/popen.rb:209:in `mentos'
    from /Library/Ruby/Gems/1.8/gems/pygments.rb-0.5.0/lib/pygments/popen.rb:192:in `highlight'
    from /Library/Ruby/Gems/1.8/gems/jekyll-1.0.3/bin/../lib/jekyll/tags/highlight.rb:57:in `render_pygments'
    from /Library/Ruby/Gems/1.8/gems/jekyll-1.0.3/bin/../lib/jekyll/tags/highlight.rb:45:in `render'
    from /Library/Ruby/Gems/1.8/gems/liquid-2.5.0/lib/liquid/block.rb:106:in `render_all'
    from /Library/Ruby/Gems/1.8/gems/liquid-2.5.0/lib/liquid/block.rb:93:in `each'
    from /Library/Ruby/Gems/1.8/gems/liquid-2.5.0/lib/liquid/block.rb:93:in `render_all'
    from /Library/Ruby/Gems/1.8/gems/liquid-2.5.0/lib/liquid/block.rb:82:in `render'
    from /Library/Ruby/Gems/1.8/gems/liquid-2.5.0/lib/liquid/template.rb:124:in `render'
    from /Library/Ruby/Gems/1.8/gems/liquid-2.5.0/lib/liquid/template.rb:132:in `render!'
    from /Library/Ruby/Gems/1.8/gems/jekyll-1.0.3/bin/../lib/jekyll/convertible.rb:77:in `render_liquid'
    from /Library/Ruby/Gems/1.8/gems/jekyll-1.0.3/bin/../lib/jekyll/convertible.rb:125:in `do_layout'
    from /Library/Ruby/Gems/1.8/gems/jekyll-1.0.3/bin/../lib/jekyll/post.rb:263:in `render'
    from /Library/Ruby/Gems/1.8/gems/jekyll-1.0.3/bin/../lib/jekyll/site.rb:228:in `render'
    from /Library/Ruby/Gems/1.8/gems/jekyll-1.0.3/bin/../lib/jekyll/site.rb:227:in `each'
    from /Library/Ruby/Gems/1.8/gems/jekyll-1.0.3/bin/../lib/jekyll/site.rb:227:in `render'
    from /Library/Ruby/Gems/1.8/gems/jekyll-1.0.3/bin/../lib/jekyll/site.rb:44:in `process'
    from /Library/Ruby/Gems/1.8/gems/jekyll-1.0.3/bin/../lib/jekyll/command.rb:18:in `process_site'
    from /Library/Ruby/Gems/1.8/gems/jekyll-1.0.3/bin/../lib/jekyll/commands/build.rb:23:in `build'
    from /Library/Ruby/Gems/1.8/gems/jekyll-1.0.3/bin/../lib/jekyll/commands/build.rb:7:in `process'
    from /Library/Ruby/Gems/1.8/gems/jekyll-1.0.3/bin/jekyll:61
    from /Library/Ruby/Gems/1.8/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
    from /Library/Ruby/Gems/1.8/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
    from /Library/Ruby/Gems/1.8/gems/commander-4.1.3/lib/commander/command.rb:155:in `run'
    from /Library/Ruby/Gems/1.8/gems/commander-4.1.3/lib/commander/runner.rb:402:in `run_active_command'
    from /Library/Ruby/Gems/1.8/gems/commander-4.1.3/lib/commander/runner.rb:78:in `run!'
    from /Library/Ruby/Gems/1.8/gems/commander-4.1.3/lib/commander/delegates.rb:7:in `run!'
    from /Library/Ruby/Gems/1.8/gems/commander-4.1.3/lib/commander/import.rb:10
    from /usr/bin/jekyll:23
datum:foo$ python --version
Python 2.6.1
datum:foo$ jekyll --version
jekyll 1.0.3
@parkr

This comment has been minimized.

Member

parkr commented Jun 25, 2013

Try updating to Ruby 1.9 or 2.0 and try again.

@antonmedv

This comment has been minimized.

antonmedv commented Jul 12, 2013

Get this error too =( Ruby 1.8 on Mac OS.

@parkr

This comment has been minimized.

Member

parkr commented Jul 12, 2013

@Elfet What version of pygments.rb and jekyll?

@antonmedv

This comment has been minimized.

antonmedv commented Jul 12, 2013

@parkr jekyll 1.0.3 and pygments.rb 0.5.1.
I first time today install ruby and all this things on my macbook.

@parkr

This comment has been minimized.

Member

parkr commented Jul 12, 2013

@Elfet What version of python? This is only compatible with 2.6 < x < 3.0 (so not 3 :))

@parkr

This comment has been minimized.

Member

parkr commented Jul 12, 2013

@antonmedv

This comment has been minimized.

antonmedv commented Jul 12, 2013

Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin

@parkr

This comment has been minimized.

Member

parkr commented Jul 13, 2013

Hm, then I'm not sure what the issue is... :/

@millisami

This comment has been minimized.

millisami commented Jul 14, 2013

Same with mine.

Python 2.7.3
jekyll 1.0.3

Ruby: 1.9.3-p194.

@qvn

This comment has been minimized.

qvn commented Aug 7, 2013

Woops. I got the same problem after updating to Lion, installing Xcode and its command line tools. Re-install python 2.7.x fixed it. Thanks.

@maurogeorge

This comment has been minimized.

maurogeorge commented Sep 14, 2013

Got the same error here on ruby 2.0.0, Python 2.6.1 on OS X 10.6.8.

Fixed after install python with homebrew.

@flashlib

This comment has been minimized.

flashlib commented Feb 25, 2014

Just for a reference to those who meet the same problem like me. I had python 2.7.6 installed first and then installed python 3.3.0. So re-install python 2.7.6 fixed the problem for me. Thanks @olidin.

pygments.rb (0.5.4)
Python 2.7.6
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
jekyll 1.4.3
OSX 10.8.5
@uglyyouth

This comment has been minimized.

uglyyouth commented Feb 28, 2014

Same problem

Ruby 2.0.0
Python 3.3.3
@mattr-

This comment has been minimized.

Member

mattr- commented Feb 28, 2014

@uglyyouth you'll need to use Python 2 in order to get Pygments highlighting with Jekyll.

@SpeedMe

This comment has been minimized.

SpeedMe commented Apr 11, 2014

Ruby 2.0.0 and Python 3.3.3 has problems.
windows 8.1 .solution for me was downgrading to Python 2.7 and it works
you need to have a couple of compatible versions of the required Ruby, Python and Pygments.
for me
Ruby 2.0.0
Python 2.7.6
Pygments 0.5.0

@Macxim

This comment has been minimized.

Macxim commented Aug 24, 2014

Hi, I have also some issues with pygments.rb.
Here are some details:

  • Mac OS X 10.6.8
  • RVM list
    • ruby-1.9.3-p547 [ i386 ]
    • ruby-2.0.0-p353 [ i386 ]
    • =* ruby-2.1.2 [ i386 ]
  • pygments.rb (0.6.0, 0.5.0)
  • Jekyll 2.3.0
  • Python 2.7.8

As you can see, I have multiple versions of Ruby and pygments.rb and even tried with Python 2.7.8 and 2.7.6.
Still no luck though.

@parkr

This comment has been minimized.

Member

parkr commented Aug 24, 2014

@Macxim Where is your Python installed?

@Macxim

This comment has been minimized.

Macxim commented Aug 24, 2014

$ which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python

Actually, I just went to https://www.python.org/downloads/ and selected the 2.7.8 version and followed the installer.

@parkr

This comment has been minimized.

Member

parkr commented Aug 24, 2014

Which version of posix-spawn do you have installed?

@Macxim

This comment has been minimized.

Macxim commented Aug 24, 2014

This one: posix-spawn (0.3.9)

Edit:
On another computer it worked just fine with:

  • ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin11.4.2]
  • pygments.rb (0.6.0, 0.5.4)
  • jekyll (2.3.0, 2.0.2)
  • posix-spawn (0.3.8)
  • Python 2.7.5

takashi added a commit to takashi/takashi.github.io that referenced this issue Oct 3, 2014

lock python version
because python3 will occurs error with pigments
jekyll/jekyll#1181
@mtitolo

This comment has been minimized.

mtitolo commented Oct 17, 2014

Still having issues with this on a fresh install, and none of the listed solutions work.

@parkr

This comment has been minimized.

Member

parkr commented Oct 17, 2014

@mtitolo What is the output of python --version? What OS are you running?

@mtitolo

This comment has been minimized.

mtitolo commented Oct 17, 2014

@parkr Fresh install on OS X 10.9.4, Python 2.7.8, ruby 2.0.0p481. I did manage to get it working a few hours after my last comment.

I've only used python on this machine with virtualenv, but somehow I had to remove a bunch of packages from /Library/Python/2.7/site-packages to get this to work. This comment on pygments.rb has a similar solution, and running python mentos.py was the only way to figure out exactly what was causing the problem. Hopefully this info helps someone else with setup.

@parkr

This comment has been minimized.

Member

parkr commented Oct 17, 2014

@mtitolo Sorry you ran into that issue. Just so I understand, you cd'd into the pygments.rb gem directory, then into the lib/pygments directory within and executed python mentos.py? What was the problem it showed you?

@mtitolo

This comment has been minimized.

mtitolo commented Oct 17, 2014

@parkr correct. I went into the gem, found mentos.py and executed it. The errors were variations on the ones listed in the comment over on the pygments.rb issue, but the path printed was into /Library. For some reason python decided to use the packages there instead of the ones on the currently active python.

@qwertie

This comment has been minimized.

qwertie commented Dec 15, 2014

I have never been able to get Pygments to work on Windows so I use Rouge. Today I got this error even though I set

highlighter: rouge    # in _config.yml

I wonder why it is still trying to use pygments :(

@parkr

This comment has been minimized.

Member

parkr commented Dec 15, 2014

@qwertie You checked all possible configuration files?

@qwertie

This comment has been minimized.

qwertie commented Dec 15, 2014

I am not aware of the existence of any other configuration files.

@parkr

This comment has been minimized.

Member

parkr commented Dec 15, 2014

@qwertie Check to make sure your _config.y(a)ml file contains only one instance of highlighter: rouge. Is there a link to your site I can check out?

@qwertie

This comment has been minimized.

qwertie commented Dec 16, 2014

Yes, there's only one "highlighter". I just realized this could be an old bug since my local PC is still configured for Jekyll 1.5.1, as previously used on GitHub (and since GitHub requires pygments, I always change the highlighter temporarily before uploading _config.yml). It worked 6 months ago, I don't know what changed (oh wait, I did install Python 3.4.1 in the interim). And now I can't update, as "gem install anything" gives an SSL error. Ugh.

jbrudvik added a commit to jbrudvik/hello-jekyll that referenced this issue Jan 16, 2015

Set local pyenv Python version to 2.7.9
Python 2 is required by Jekyll [Pigments, in particular?]
(jekyll/jekyll#1181)

jbrudvik added a commit to jbrudvik/website that referenced this issue Jan 16, 2015

Set local pyenv Python version to 2.7.9
Python 2 is required by Jekyll [Pigments, in particular?]
(jekyll/jekyll#1181)
@CharlJKruger

This comment has been minimized.

CharlJKruger commented Apr 14, 2015

had the same problem on windows 8, using the below resolved the issue

pygments.rb latest
Python 2.7.6
ruby 2.1.X
jekyll latest

@saysmy

This comment has been minimized.

saysmy commented Apr 29, 2015

I met the same problem on win7,the issue is:
ruby 2.0.0p645 (2015-04-13) [x64-mingw32]
jekyll 2.5.3
python 3.4.3

help.....

@talolard

This comment has been minimized.

talolard commented Jun 14, 2015

I had the same problem. I managed to solve it by using a vitualenv for python with python 2.7 (My default interpreter was 3.4).
Install virtualenv like so https://virtualenv.pypa.io/en/latest/installation.html
Then create a virtualenv, and pip install pygments and you should be good to go.

@shunfan

This comment has been minimized.

shunfan commented Jul 4, 2015

I got the same issue when I was trying to build my Jekyll blog in my ubuntu server.
The solution that worked for me is to install python and pygments (Use pip as @talolard mentioned).
Environment:
jekyll 2.5.3
ruby 2.2.1p85
Python 2.7.9

@jekyll jekyll locked and limited conversation to collaborators Jul 4, 2015

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.