为什么pygments_code.rb插件坏了?

时间:2013-05-13 07:50:11

标签: octopress

当我为我的新octopress博客运行cmd:bundle exec rake generate时,它总是失败并出现以下异常。

$ be rake generate
## Generating Site with Jekyll
identical source/stylesheets/screen.css
Configuration from /Users/millisami/Code/octopress/_config.yml
Building site: source -> public
/Users/millisami/Code/octopress/plugins/pygments_code.rb:14:in `highlight': undefined method `[]' for nil:NilClass (NoMethodError)
  from /Users/millisami/Code/octopress/plugins/backtick_code_block.rb:37:in `block in render_code_block'
  from /Users/millisami/Code/octopress/plugins/backtick_code_block.rb:13:in `gsub'
  from /Users/millisami/Code/octopress/plugins/backtick_code_block.rb:13:in `render_code_block'
  from /Users/millisami/Code/octopress/plugins/octopress_filters.rb:12:in `pre_filter'
  from /Users/millisami/Code/octopress/plugins/octopress_filters.rb:28:in `pre_render'
  from /Users/millisami/Code/octopress/plugins/post_filters.rb:112:in `block in pre_render'
  from /Users/millisami/Code/octopress/plugins/post_filters.rb:111:in `each'
  from /Users/millisami/Code/octopress/plugins/post_filters.rb:111:in `pre_render'
  from /Users/millisami/Code/octopress/plugins/post_filters.rb:166:in `do_layout'
  from /Users/millisami/Code/octopress/.bundle/gems/jekyll-0.12.1/lib/jekyll/post.rb:195:in `render'
  from /Users/millisami/Code/octopress/.bundle/gems/jekyll-0.12.1/lib/jekyll/site.rb:200:in `block in render'
  from /Users/millisami/Code/octopress/.bundle/gems/jekyll-0.12.1/lib/jekyll/site.rb:199:in `each'
  from /Users/millisami/Code/octopress/.bundle/gems/jekyll-0.12.1/lib/jekyll/site.rb:199:in `render'
  from /Users/millisami/Code/octopress/.bundle/gems/jekyll-0.12.1/lib/jekyll/site.rb:41:in `process'
  from /Users/millisami/Code/octopress/.bundle/gems/jekyll-0.12.1/bin/jekyll:264:in `<top (required)>'
  from /Users/millisami/Code/octopress/.bundle/bin/jekyll:23:in `load'
  from /Users/millisami/Code/octopress/.bundle/bin/jekyll:23:in `<main>'

1 个答案:

答案 0 :(得分:0)

我也遇到了这个错误。 然后我发现代码格式不对。在```标签。

之前:

``` objc
view.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
```

后:

``` objc
view.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
```

然后错误信息消失,我也不知道为什么