新手问题 有谁熟悉 nanoc 吗?

ntoskrnl · 2012年09月30日 · 最后由 ntoskrnl 回复于 2012年10月08日 · 3021 次阅读

需要用 nanoc 更新一些文档,想在本地跑起来测试一下效果。

nanoc 安装完毕,文档的源文件也拿到了,bundle install 成功。

可是执行 nanoc tags,和 nanoc compile 的时候,总是报如下的错误

“LoadError: no such file to load -- CGI” 这个跟 CGI 有关系吗?

yuf@ubuntu:~/cf-docs$ nanoc tags

Captain! We’ve been hit!

=== MESSAGE:

LoadError: no such file to load -- CGI

=== COMPILATION STACK:

(empty)

=== BACKTRACE:

  1. /home/yuf/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  2. /home/yuf/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  3. lib/fenced_code_block.rb:1:in `'
  4. /home/yuf/.rvm/gems/ruby-1.9.2-p320@docs/gems/nanoc3-3.2.4/lib/nanoc3/base/source_data/code_snippet.rb:36:in `eval'
  5. /home/yuf/.rvm/gems/ruby-1.9.2-p320@docs/gems/nanoc3-3.2.4/lib/nanoc3/base/source_data/code_snippet.rb:36:in `load'
  6. /home/yuf/.rvm/gems/ruby-1.9.2-p320@docs/gems/nanoc3-3.2.4/lib/nanoc3/base/source_data/site.rb:300:in `block in load_code_snippets'
  7. /home/yuf/.rvm/gems/ruby-1.9.2-p320@docs/gems/nanoc3-3.2.4/lib/nanoc3/base/source_data/site.rb:300:in `each'
  8. /home/yuf/.rvm/gems/ruby-1.9.2-p320@docs/gems/nanoc3-3.2.4/lib/nanoc3/base/source_data/site.rb:300:in `load_code_snippets'
  9. /home/yuf/.rvm/gems/ruby-1.9.2-p320@docs/gems/nanoc3-3.2.4/lib/nanoc3/base/source_data/site.rb:244:in `load'
  10. /home/yuf/.rvm/gems/ruby-1.9.2-p320@docs/gems/nanoc3-3.2.4/lib/nanoc3/base/source_data/site.rb:118:in `items'
  11. commands/tags.rb:25:in `block in define'
  12. /home/yuf/.rvm/gems/ruby-1.9.2-p320@docs/gems/cri-2.1.0/lib/cri/command.rb:255:in `call'
  13. /home/yuf/.rvm/gems/ruby-1.9.2-p320@docs/gems/cri-2.1.0/lib/cri/command.rb:255:in `run'
  14. /home/yuf/.rvm/gems/ruby-1.9.2-p320@docs/gems/cri-2.1.0/lib/cri/command.rb:272:in `run'
  15. /home/yuf/.rvm/gems/ruby-1.9.2-p320@docs/gems/nanoc3-3.2.4/lib/nanoc3/cli.rb:40:in `block in run'
  16. /home/yuf/.rvm/gems/ruby-1.9.2-p320@docs/gems/nanoc3-3.2.4/lib/nanoc3/cli/error_handler.rb:42:in `handle_while'
  17. /home/yuf/.rvm/gems/ruby-1.9.2-p320@docs/gems/nanoc3-3.2.4/lib/nanoc3/cli/error_handler.rb:23:in `handle_while'
  18. /home/yuf/.rvm/gems/ruby-1.9.2-p320@docs/gems/nanoc3-3.2.4/lib/nanoc3/cli.rb:37:in `run'
  19. /home/yuf/.rvm/gems/ruby-1.9.2-p320@docs/gems/nanoc3-3.2.4/bin/nanoc3:12:in `'
  20. /home/yuf/.rvm/gems/ruby-1.9.2-p320@docs/bin/nanoc3:23:in `load'
  21. /home/yuf/.rvm/gems/ruby-1.9.2-p320@docs/bin/nanoc3:23:in `'

If you believe this is a bug in nanoc, please do report it at https://github.com/ddfreyne/nanoc/issues/new--thanks! yuf@ubuntu:~/cf-docs$

lib/fenced_code_block.rb 更新下,require 'CGI' 改成 require 'cgi'

谢谢楼上的建议!

需要 登录 后方可回复, 如果你还没有账号请 注册新账号