怎么做?`nanoc compile`运行正常。 `bundle exec nanoc compile`没有

时间:2011-11-07 20:37:18

标签: ruby bundler nanoc

温我在我的nanoc网站上运行nanoc compile所有内容。当我运行bundle exec nanoc compile时,收到此错误消息:

  RuntimeError: Error processing : /markup/post/
  undefined method `gsub!' for 2008-01-28 15:44:48 -0500:Time

  === COMPILATION STACK:

  (empty)

  === BACKTRACE:

  0. ./Rules:50:in `rescue in block in load'
  1. ./Rules:43:in `block in load'
  2. /Users/mike/.gem/gems/nanoc3-3.2.3/lib/nanoc3/base/compilation/rule.rb:68:in `instance_eval'
  3. /Users/mike/.gem/gems/nanoc3-3.2.3/lib/nanoc3/base/compilation/rule.rb:68:in `apply_to'
  4. /Users/mike/.gem/gems/nanoc3-3.2.3/lib/nanoc3/base/compilation/compiler.rb:377:in `compile_rep'
  5. /Users/mike/.gem/gems/nanoc3-3.2.3/lib/nanoc3/base/compilation/compiler.rb:333:in `block in compile_reps'
  6. /Users/mike/.gem/gems/nanoc3-3.2.3/lib/nanoc3/base/compilation/compiler.rb:326:in `loop'
  7. /Users/mike/.gem/gems/nanoc3-3.2.3/lib/nanoc3/base/compilation/compiler.rb:326:in `compile_reps'
  8. /Users/mike/.gem/gems/nanoc3-3.2.3/lib/nanoc3/base/compilation/compiler.rb:85:in `run'
  9. /Users/mike/.gem/gems/nanoc3-3.2.3/lib/nanoc3/base/source_data/site.rb:57:in `compile'
  10. /Users/mike/.gem/gems/nanoc3-3.2.3/lib/nanoc3/cli/commands/compile.rb:61:in `run'
  11. /Users/mike/.gem/gems/nanoc3-3.2.3/lib/nanoc3/cli/command.rb:51:in `block in call'
  12. /Users/mike/.gem/gems/nanoc3-3.2.3/lib/nanoc3/cli/error_handler.rb:42:in `handle_while'
  13. /Users/mike/.gem/gems/nanoc3-3.2.3/lib/nanoc3/cli/error_handler.rb:23:in `handle_while'
  14. /Users/mike/.gem/gems/nanoc3-3.2.3/lib/nanoc3/cli/command.rb:50:in `call'
  15. /Users/mike/.gem/gems/nanoc3-3.2.3/lib/nanoc3/cli/command.rb:43:in `call'
  16. /Users/mike/.gem/gems/nanoc3-3.2.3/lib/nanoc3/cli/commands/compile.rb:24:in `block in define'
  17. /Users/mike/.gem/gems/cri-2.0.2/lib/cri/command.rb:255:in `call'
  18. /Users/mike/.gem/gems/cri-2.0.2/lib/cri/command.rb:255:in `run'
  19. /Users/mike/.gem/gems/cri-2.0.2/lib/cri/command.rb:272:in `run'
  20. /Users/mike/.gem/gems/nanoc3-3.2.3/lib/nanoc3/cli.rb:40:in `block in run'
  21. /Users/mike/.gem/gems/nanoc3-3.2.3/lib/nanoc3/cli/error_handler.rb:42:in `handle_while'
  22. /Users/mike/.gem/gems/nanoc3-3.2.3/lib/nanoc3/cli/error_handler.rb:23:in `handle_while'
  23. /Users/mike/.gem/gems/nanoc3-3.2.3/lib/nanoc3/cli.rb:37:in `run'
  24. /Users/mike/.gem/gems/nanoc3-3.2.3/bin/nanoc3:12:in `<top (required)>'
  25. /Users/mike/.gem/bin/nanoc3:19:in `load'
  26. /Users/mike/.gem/bin/nanoc3:19:in `<main>'

我运行rm -rf ~/.gembundle update以获得一组干净的宝石。我仍然会得到同样的差异。

我该怎么办?我认为这是一个gem / bundler问题?

更新

据我所知,两种版本的nanoc都是相同的。然而,我仍然有同样的行为。

.bioinformatics-zen (develop:-*--) : nanoc --version
nanoc 3.2.3 (c) 2007-2011 Denis Defreyne.
Running ruby 1.9.2 (2011-07-09) on x86_64-darwin10.8.0 with RubyGems 1.8.11

.bioinformatics-zen (develop:-*--) : bundle exec nanoc --version
nanoc 3.2.3 (c) 2007-2011 Denis Defreyne.
Running ruby 1.9.2 (2011-07-09) on x86_64-darwin10.8.0 with RubyGems 1.8.11

2 个答案:

答案 0 :(得分:1)

默认的YAML解析器已更改。新的一个,Psych,并不解析与旧的相同的东西,syck。您可以使用旧解析器修复此问题:

YAML :: ENGINE.yamler ='syck'

答案 1 :(得分:0)

这不是gem / bundler问题,但更可能是不同nanoc版本中不同行为的问题。以下命令返回什么内容?

nanoc --version
bundle exec nanoc --version

你听到的错误听起来很熟悉,但最近版本的nanoc不应该出现(很久以前就修好了,所以我想Gemfile包含旧版本的nanoc。)

HTH,

丹尼斯