2013-12-07 19 views
4

刚刚撬开了我的电脑,我一段时间都没有使用过Jekyll,或者说Ruby,但是我认为我已经正确设置了一切,我尝试运行...Jekyll构建失败:液体例外:无法加载这样的文件 - yajl

jekyll build or jekyll serve

我得到这个错误:

Generating... Liquid Exception: cannot load such file -- yajl/2.0/yajl i 
n _posts/2013-09-21-welcome-to-jekyll.markdown 
C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in `require': c 
annot load such file -- yajl/2.0/yajl (LoadError) 
     from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in 
`require' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/yajl-ruby-1.1.0-x86-mingw32/lib 
/yajl/yajl.rb:2:in `<top (required)>' 
     from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in 
`require' 
     from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in 
`require' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/yajl-ruby-1.1.0-x86-mingw32/lib 
/yajl.rb:1:in `<top (required)>' 
     from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:118:i 
n `require' 
     from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:118:i 
n `rescue in require' 
     from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:124:i 
n `require' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/pygments.rb-0.5.4/lib/pygments/ 
popen.rb:3:in `<top (required)>' 
     from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:114:i 
n `require' 
     from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:114:i 
n `require' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/pygments.rb-0.5.4/lib/pygments. 
rb:1:in `<top (required)>' 
     from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:66:in 
`require' 
     from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:66:in 
`require' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/tags/hi 
ghlight.rb:52:in `render_pygments' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/tags/hi 
ghlight.rb:45:in `render' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.4/lib/liquid/block.r 
b:106:in `block in render_all' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.4/lib/liquid/block.r 
b:93:in `each' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.4/lib/liquid/block.r 
b:93:in `render_all' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.4/lib/liquid/block.r 
b:82:in `render' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.4/lib/liquid/templat 
e.rb:124:in `render' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/liquid-2.5.4/lib/liquid/templat 
e.rb:132:in `render!' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/convert 
ible.rb:88:in `render_liquid' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/convert 
ible.rb:150:in `do_layout' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/post.rb 
:259:in `render' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/site.rb 
:241:in `block in render' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/site.rb 
:240:in `each' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/site.rb 
:240:in `render' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/site.rb 
:39:in `process' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/command 
.rb:18:in `process_site' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/command 
s/build.rb:23:in `build' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/command 
s/build.rb:7:in `process' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/bin/jekyll:77:in ` 
block (2 levels) in <top (required)>' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/c 
ommand.rb:180:in `call' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/c 
ommand.rb:180:in `call' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/c 
ommand.rb:155:in `run' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/r 
unner.rb:402:in `run_active_command' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/r 
unner.rb:66:in `run!' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/d 
elegates.rb:7:in `run!' 
     from C:/Ruby200/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/i 
mport.rb:10:in `block in <top (required)>' 

我认为它以某种方式pygments.rb有关。如果我删除了具有语法高亮显示的第一篇文章,则构建工作。我试图将pgyments更新为0.5.4,但这似乎没有什么不同。我想有一个错误,pygments.rb被锁定为0.3.4:

Fetching gem metadata from https://rubygems.org/....... 
Fetching gem metadata from https://rubygems.org/.. 
Resolving dependencies... 
You have requested: 
    pygments.rb ~> 0.5.4 

The bundle currently has pygments.rb locked at 0.3.7. 
Try running `bundle update pygments.rb` 

任何人都可以对此有所了解吗?这让我疯狂。运行Ruby 2.0.0p353。

+0

你运行'bundle'吗?或者试过'gem install yajl'? –

+0

是的,yajl失败,因为它说:错误:无法在任何存储库中找到有效的gem'yajl'(> = 0) – Doidgey

回答

1

我这个解决方案今天尝试安装Octopres时遇到类似的问题S /化身。

这是我找到的解决方案。

步骤1

转到您的红宝石宝石目录。 在我的情况下,它位于C:/Ruby21/lib/ruby/gems/2.1.0/gems

寻找yajl。

image1

你会看到一个文件夹,名为yajl-ruby-1.1.0-x86-mingw32

您可能会或可能不会看到一个叫yajl-ruby-1.2.1

的一个具有-ruby-1.1.0-x86架构的mingw32尾是默认值。并导致错误。

我们要使用什么是其他版本

步骤2

如果你没有在没有的mingw32版本,运行

gem install yajl-ruby 

这将安装最新版本。

在我的情况下,最新的版本是1.2.1

步骤3

变化从的mingw32版本升级到当前版本的默认。

要做到这一点,去你的网站的gemfile.lock文件

查找说yajl-ruby (1.1.0-x86-mingw32)

行并将其更改为yajl-ruby (1.2.1)

,或者你下载

img_before img_after各个版本

步骤4

就是这样。它现在应该工作。

0

Yajl本身就是一个“小事件驱动(SAX样式)JSON ANSI C编写,解析器。”你应该在你的Windows中安装它(我不知道是否有可用的二进制下载,可能你需要下载源文件并用你的首选C编译器编译它们)之前试图安装yajl-ruby gem,它只是它的绑定。

另一种选择是安装Ruby开发工具包,详细说明请参考this manual

+0

我已经安装了开发包,但它没有解决我的问题 – Doidgey

+0

我没有联系与Windows多年,但你会尝试调用'yajl --version'并从源安装yajl,如果它是<= 2.0'? – mudasobwa

+0

@ Mat-visual And,BTW,'yajl-ruby' gem安装扩展没有问题? – mudasobwa

相关问题