Skip to content

gem rdoc gem_name fails with undefined method 'force=' for an instance of RDoc::RubygemsHook #1243

Closed

Description

@tompng

Found in Reline's CI failure https://github.com/ruby/reline/actions/runs/12330703999
Failed jobs are irb [2.7..3.3 and head] ubuntu latest

Reproduction:

$ docker run --rm -ti rubylang/rubyfarm
root@bacda24563ca:/# ruby -v
ruby 3.4.0dev (2024-12-15T13:36:38Z master 366fd9642f) +PRISM [x86_64-linux]
root@bacda24563ca:/# gem rdoc readline
ERROR:  While executing gem ... (NoMethodError)
    undefined method 'force=' for an instance of RDoc::RubygemsHook

      doc.force = options[:overwrite]
         ^^^^^^^^
	/opt/ruby/lib/ruby/3.4.0+1/rubygems/commands/rdoc_command.rb:80:in 'block in Gem::Commands::RdocCommand#execute'
	/opt/ruby/lib/ruby/3.4.0+1/rubygems/commands/rdoc_command.rb:77:in 'Array#each'
	/opt/ruby/lib/ruby/3.4.0+1/rubygems/commands/rdoc_command.rb:77:in 'Gem::Commands::RdocCommand#execute'
	/opt/ruby/lib/ruby/3.4.0+1/rubygems/command.rb:326:in 'Gem::Command#invoke_with_build_args'
	/opt/ruby/lib/ruby/3.4.0+1/rubygems/command_manager.rb:253:in 'Gem::CommandManager#invoke_command'
	/opt/ruby/lib/ruby/3.4.0+1/rubygems/command_manager.rb:194:in 'Gem::CommandManager#process_args'
	/opt/ruby/lib/ruby/3.4.0+1/rubygems/command_manager.rb:152:in 'Gem::CommandManager#run'
	/opt/ruby/lib/ruby/3.4.0+1/rubygems/gem_runner.rb:57:in 'Gem::GemRunner#run'
	/opt/ruby/bin/gem:12:in '<main>'

RDoc::Ruby"G"emsHook have method force= but RDoc::Ruby"g"emsHook used by rubygems does not have it.

Activity

  1. st0012 commented on Dec 15, 2024

    @st0012
    Member

    I think this is related to #1171. cc @hsbt @mterada1228

    IMO, RubygemsHook should delegate all previously supported methods to RubyGemsHook to achieve real compatibility support. I'll open a PR later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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