Rubocop: Error parsing documentation for rubocop-0.69.0

Created on 14 May 2019  路  4Comments  路  Source: rubocop-hq/rubocop

Installing rubocop fails due to error while parsing the documentation. This began to fail for me yesterday, which lines up with the 0.69.0 release.

The error is as follows:

Parsing documentation for rubocop-0.69.0

RDoc::Parser::Ruby failure around line 16 of
lib/rubocop/cop/generator.rb

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

  /usr/bin/ruby2.3 -c lib/rubocop/cop/generator.rb

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

The internal error was:

    (NoMethodError) undefined method `name' for {TkSTRING 481, 16:19 "%Q<department>"}:RDoc::RubyToken::TkSTRING

ERROR:  While executing gem ... (NoMethodError)
    undefined method `name' for {TkSTRING 481, 16:19 "%Q<department>"}:RDoc::RubyToken::TkSTRING

Expected behavior

Installing rubocop succeeds.

Actual behavior

Installing rubocop fails.

Steps to reproduce the problem

Here's an easy way to reproduce this:

docker run --rm -ti ubuntu:16.04 bash -c 'apt-get update && apt-get install -y gcc make ruby-dev && gem install rubocop'

RuboCop version

0.69.0 (using Parser 2.6.3.0, running on ruby 2.3.1 x86_64-linux-gnu)

All 4 comments

NOTE: as a workaround, I'm currently using gem install --no-rdoc --no-ri rubocop

Also note that this is only an issue on Ubuntu 16.04 (ruby version ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]) but not on Ubuntu 18.04 (ruby version: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu])

In other words, this works:

docker run --rm -ti ubuntu:18.04 bash -c 'apt-get update && apt-get install -y gcc make ruby-dev && gem install rubocop'

Possibly related to this commit - https://github.com/rubocop-hq/rubocop/pull/7026/commits/05f25f30935b032650924e89ae336572df6998d6

PS: Installation works fine on MacOS Mojave.

I confirmed that and I opened a PR #7047.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bquorning picture bquorning  路  3Comments

david942j picture david942j  路  3Comments

NobodysNightmare picture NobodysNightmare  路  3Comments

bbatsov picture bbatsov  路  3Comments

deivid-rodriguez picture deivid-rodriguez  路  3Comments