Skip to content

Raise NoMethodError when installing Active Record with Rdoc 6.0.0  #571

@y-yagi

Description

@y-yagi

RDoc version

6.0.0

Steps to reproduce

Install Active Record with document generating.

$ gem install activerecord
Successfully installed activerecord-5.1.4
Parsing documentation for activerecord-5.1.4

RDoc::Parser::Ruby failure around line 1 of
lib/rails/generators/active_record/migration/templates/create_table_migration.rb

Before reporting this, could you check that the file you're documenting
has proper syntax:

  /home/yaginuma/.rbenv/versions/2.3.1/bin/ruby -c lib/rails/generators/active_record/migration/templates/create_table_migration.rb

RDoc is not a full Ruby parser and will fail when fed invalid ruby programs.

The internal error was:

	(NoMethodError) undefined method `[]' for nil:NilClass

ERROR:  While executing gem ... (NoMethodError)
    undefined method `[]' for nil:NilClass 

Cause

There are template files of Thor gem that extension is rb in Active Record. It seems that it is an error trying to parse it.

Since we have changed the extension of templates files in rails/rails@8dd76a7, this problem does not happen in Rails 5.2.0.
But old versions have this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions