Rdoc,YARD和irb,在数组上使用intern方法?

时间:2016-08-04 22:09:50

标签: ruby rdoc yard

我只是想为我的宝石生成文档,并且在运行rdoc或yard时我得到了错误

undefined method `intern' for []:Array

发生了什么事?我正在尝试重新安装所有内容,而我正在使用ruby 2.3.1。另外,根据我的理解,你不能在数组上使用实习生,那么为什么rdoc和yard会尝试这样做呢?

修改

我现在进一步调查,它与我的特定语法有关,因为我的设置适用于其他文件,而不是我的。如何检查哪个文件有语法问题?

RDoc全堆栈跟踪(看起来与YARD跟踪相同,但我已将两者都包括在内):

error generating : Error while evaluating /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/generator/template/darkfish/page.rhtml: undefined method `intern' for []:Array (RDoc::Error)
/home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/markdown.rb:15678:in `_CodeFence'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/markdown.rb:470:in `apply'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/markdown.rb:902:in `_Block'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/markdown.rb:470:in `apply'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/markdown.rb:856:in `_Doc'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/markdown.rb:470:in `apply'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/markdown.rb:834:in `_root'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/markdown.rb:470:in `apply'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/markdown.rb:372:in `parse'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/markdown.rb:780:in `parse'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/markdown.rb:611:in `parse'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/text.rb:143:in `parse'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/comment.rb:181:in `parse'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/text.rb:137:in `parse'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml:6:in `block in generate_page'
    /home/isaiah/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/erb.rb:864:in `eval'
    /home/isaiah/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/erb.rb:864:in `result'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/generator/darkfish.rb:678:in `render'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/generator/template/darkfish/page.rhtml:33:in `block in generate_page'
    /home/isaiah/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/erb.rb:864:in `eval'
    /home/isaiah/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/erb.rb:864:in `result'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/generator/darkfish.rb:725:in `template_result'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/generator/darkfish.rb:704:in `block in render_template'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/generator/darkfish.rb:699:in `open'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/generator/darkfish.rb:699:in `open'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/generator/darkfish.rb:699:in `render_template'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/generator/darkfish.rb:467:in `generate_page'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/generator/darkfish.rb:407:in `block in generate_file_files'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/generator/darkfish.rb:403:in `each'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/generator/darkfish.rb:403:in `generate_file_files'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/generator/darkfish.rb:246:in `generate'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/rdoc.rb:534:in `block in generate'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/rdoc.rb:529:in `chdir'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/rdoc.rb:529:in `generate'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/rdoc.rb:512:in `document'
    /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/bin/rdoc:20:in `<top (required)>'
    /home/isaiah/.rvm/gems/ruby-2.3.1/bin/rdoc:23:in `load'
    /home/isaiah/.rvm/gems/ruby-2.3.1/bin/rdoc:23:in `<main>'
    /home/isaiah/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'
    /home/isaiah/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'

YARD Full Stack Trace:

/home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/markdown.rb:15678:in `_CodeFence': undefined method `intern' for []:Array (NoMethodError)
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/markdown.rb:470:in `apply'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/markdown.rb:902:in `_Block'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/markdown.rb:470:in `apply'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/markdown.rb:856:in `_Doc'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/markdown.rb:470:in `apply'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/markdown.rb:834:in `_root'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/markdown.rb:470:in `apply'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/markdown.rb:372:in `parse'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/rdoc-4.2.2/lib/rdoc/markdown.rb:780:in `parse'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/helpers/markup/rdoc_markdown.rb:14:in `initialize'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/helpers/html_helper.rb:67:in `new'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/helpers/html_helper.rb:67:in `html_markup_markdown'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/helpers/html_helper.rb:41:in `htmlify'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/templates/default/layout/html/setup.rb:65:in `diskfile'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/template.rb:355:in `render_section'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/template.rb:251:in `block (2 levels) in run'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/template.rb:248:in `each'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/template.rb:248:in `block in run'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/template.rb:386:in `add_options'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/template.rb:247:in `run'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/template.rb:269:in `block in yieldall'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/template.rb:400:in `with_section'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/template.rb:269:in `yieldall'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/templates/default/layout/html/layout.erb:23:in `_erb_cache_5'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/template.rb:279:in `erb'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/templates/default/layout/html/setup.rb:60:in `layout'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/template.rb:355:in `render_section'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/template.rb:251:in `block (2 levels) in run'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/template.rb:248:in `each'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/template.rb:248:in `block in run'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/template.rb:386:in `add_options'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/template.rb:247:in `run'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/template.rb:135:in `run'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/templates/default/fulldoc/html/setup.rb:51:in `block in serialize_index'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/engine.rb:122:in `block in with_serializer'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/logging.rb:70:in `capture'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/engine.rb:120:in `with_serializer'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/templates/default/fulldoc/html/setup.rb:50:in `serialize_index'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/templates/default/fulldoc/html/setup.rb:67:in `serialize_file'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/templates/default/fulldoc/html/setup.rb:10:in `block in init'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/templates/default/fulldoc/html/setup.rb:9:in `each'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/templates/default/fulldoc/html/setup.rb:9:in `each_with_index'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/templates/default/fulldoc/html/setup.rb:9:in `init'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/template.rb:185:in `initialize'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/template.rb:130:in `new'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/template.rb:135:in `run'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/templates/engine.rb:104:in `generate'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/cli/yardoc.rb:346:in `run_generate'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/cli/yardoc.rb:260:in `run'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/cli/command.rb:13:in `run'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/cli/command_parser.rb:71:in `run'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/lib/yard/cli/command_parser.rb:53:in `run'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/gems/yard-0.9.5/bin/yard:12:in `<top (required)>'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/bin/yard:23:in `load'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/bin/yard:23:in `<main>'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'
    from /home/isaiah/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'

1 个答案:

答案 0 :(得分:-2)

哇@thesecretmaster我无法相信你是如此愚蠢到没有意识到这是你在README.md中使用的特定语法的问题。关于你在rdoc github页面上打开an issue的时间。