Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby Jekyll生成失败:液体异常:无法加载此类文件--yajl_Ruby_Gem_Jekyll - Fatal编程技术网

Ruby Jekyll生成失败:液体异常:无法加载此类文件--yajl

Ruby Jekyll生成失败:液体异常:无法加载此类文件--yajl,ruby,gem,jekyll,Ruby,Gem,Jekyll,就在最近,我把我的电脑刷了个底朝天,我已经有一段时间没有用过Jekyll了,或者说Ruby了,但是在我想我已经把所有的东西都设置好了之后,当我试着运行的时候 杰基尔建筑公司 杰基尔发球 我得到这个错误: 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/

就在最近,我把我的电脑刷了个底朝天,我已经有一段时间没有用过Jekyll了,或者说Ruby了,但是在我想我已经把所有的东西都设置好了之后,当我试着运行的时候

杰基尔建筑公司 杰基尔发球

我得到这个错误:

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)>'
有人能解释一下吗?它快把我逼疯了。运行Ruby 2.0.0p353。

本身是一个“用ANSI C编写的小事件驱动(SAX风格)JSON解析器”。您应该将其安装在Windows设备上(我不确定是否有二进制下载可用,您可能需要下载源代码并使用首选的
C
编译器进行编译)在尝试安装
yajl-ruby
gem之前,它只是对它的绑定

另一个选项是安装Ruby开发工具包,有关详细说明,请参阅

gem install rouge
然后 在\u config.yml中添加了以下行

highlighter: rouge
我从下一页的最后一条评论中找到了这个解决方案

我今天在尝试设置Octopress/Jekyll时遇到了类似的问题

这是我找到的解决办法

步骤1

转到您的ruby gems目录。 在我的例子中,它位于
C:/Ruby21/lib/ruby/gems/2.1.0/gems

寻找yajl

您将看到一个名为
yajl-ruby-1.1.0-x86-mingw32

您可能会看到一个名为
yajl-ruby-1.2.1

带有-ruby-1.1.0-x86-mingw32尾部的是默认值。并导致错误

我们想要使用的是另一个版本

步骤2

如果没有nonemingw32版本,请运行

gem install yajl-ruby
这将安装最新版本

就我而言,最新版本是1.2.1

步骤3

将默认值从mingw32版本更改为当前版本

要执行此操作,请转到网站的
gemfile.lock
文件

找到写着
yajl-ruby(1.1.0-x86-mingw32)

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

或下载的相应版本

步骤4


就这样。它现在应该可以工作了。

您运行了
捆绑包了吗?或者尝试了
gem安装yajl
?是的,都失败了,因为它说:错误:在任何存储库中都找不到有效的gem“yajl”(>=0)。我已经安装了devkit,但没有解决问题,因为meI多年没有接触windows,但是如果yajl是
@Mat visual,那么您会尝试调用
yajl--version
并从源代码安装yajl吗?顺便说一句,
yajl ruby
gem安装扩展没有问题吗?
gem install yajl-ruby