Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tompng opened this issue Dec 15, 2024 · 1 comment · Fixed by #1244
Closed

Comments

@tompng
Copy link
Member

tompng commented Dec 15, 2024

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.

@st0012
Copy link
Member

st0012 commented Dec 15, 2024

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
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants