Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jekyll - Liquid Exception: cannot load such file -- yajl/2.0/yajl

Tags:

ruby

jekyll

I am trying to get Jekyll working on Windows and am having no luck. This is the first time I've installed/used Ruby.

  • Ruby version: ruby 2.0.0p0 (2013-02-24) [i386-mingw32] (http://rubyinstaller.org/)

  • Jekyll version: jekyll 1.0.1

The error goes away when I set pygments to false in _config.yml.

Error message

D:\Code\Jekyll\test>jekyll serve
Configuration file: D:/Code/Jekyll/test/_config.yml
            Source: D:/Code/Jekyll/test
       Destination: D:/Code/Jekyll/test/_site
      Generating...   Liquid Exception: cannot load such file -- yajl/2.0/yajl in 2013-05-11-welcome-to-jekyll.markdown
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/yajl-ruby-1.1.0-x86-mingw32/lib/yajl/yajl.rb:2:in `<top (required)>'
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/yajl-ruby-1.1.0-x86-mingw32/lib/yajl.rb:1:in `<top (required)>'
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/pygments.rb-0.4.2/lib/pygments/popen.rb:3:in `<top (required)>'
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/pygments.rb-0.4.2/lib/pygments.rb:1:in `<top (required)>'
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/tags/highlight.rb:52:in `render_pygments'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/tags/highlight.rb:45:in `render'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.0/lib/liquid/block.rb:106:in `block in render_all'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.0/lib/liquid/block.rb:93:in `each'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.0/lib/liquid/block.rb:93:in `render_all'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.0/lib/liquid/block.rb:82:in `render'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.0/lib/liquid/template.rb:124:in `render'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.0/lib/liquid/template.rb:132:in `render!'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/convertible.rb:77:in `render_liquid'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/convertible.rb:128:in `do_layout'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/post.rb:285:in `render'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/site.rb:230:in `block in render'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/site.rb:229:in `each'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/site.rb:229:in `render'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/site.rb:44:in `process'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/command.rb:18:in `process_site'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/commands/build.rb:23:in `build'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/lib/jekyll/commands/build.rb:7:in `process'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.0.1/bin/jekyll:83:in `block (2 levels) in <top (required)>'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/command.rb:155:in `run'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/runner.rb:402:in `run_active_command'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/runner.rb:66:in `run!'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/delegates.rb:7:in `run!'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/import.rb:10:in `block in <top (required)>'
Build Failed
like image 357
Malachi Avatar asked May 11 '13 14:05

Malachi


4 Answers

I did following

gem install rouge

and then added following line in the _config.yml

highlighter: rouge

I found this solution from following page's comment thread https://github.com/jekyll/jekyll-help/issues/50

like image 113
Abhijit Gaikwad Avatar answered Sep 24 '22 11:09

Abhijit Gaikwad


The problem was as @scriptin mentioned in the comments.

I installed ruby v 1.9.3 instead and it solved my problem.

like image 28
Malachi Avatar answered Sep 24 '22 11:09

Malachi


simply add the following line in the _config.yml

highlighter: false

Now browse to localhost:4000

like image 39
very tall Avatar answered Sep 21 '22 11:09

very tall


I encountered a similar problem today when trying to setup Octopress/Jekyll.

Here is the solution I found.

Step 1

Go to your ruby gems directory. In my case it's located at C:/Ruby21/lib/ruby/gems/2.1.0/gems

Look for yajl.

image1

You will see a folder called yajl-ruby-1.1.0-x86-mingw32

You may or may not see one called yajl-ruby-1.2.1

The one with a -ruby-1.1.0-x86-mingw32 tail is the default. And leads to the error.

What we want to use is the other version

Step 2

If you do not have the none mingw32 version, run

gem install yajl-ruby

This will install the latest version.

In my case the latest version was 1.2.1

Step 3

Change the default from the mingw32 version to the current version.

To do so, go to your website's gemfile.lock file

Find the line that says yajl-ruby (1.1.0-x86-mingw32)

and change it to yajl-ruby (1.2.1)

or the respective version you downloaded

img_beforeimg_after

Step 4

That's it. It should work now.

like image 42
Jet Blue Avatar answered Sep 21 '22 11:09

Jet Blue