Skip to content

Fix handling RDoc::Servlet rename to RDoc::RI::Servlet#14

Merged
hsbt merged 1 commit intoruby:masterfrom
junaruga:wip/fix-rdoc-servlet
May 8, 2026
Merged

Fix handling RDoc::Servlet rename to RDoc::RI::Servlet#14
hsbt merged 1 commit intoruby:masterfrom
junaruga:wip/fix-rdoc-servlet

Conversation

@junaruga
Copy link
Copy Markdown
Member

This PR fixes #12.

I tested in the cases Ruby 4.1 dev with RDoc::RI::Servlet and Ruby 4.0 with RDoc::Servlet.


This commit fixes the following error in Ruby 4.1.0dev.

bin/gem_server.rb

require 'rubygems/server'

gem_server = Gem::Server.new Gem.dir, 8089, false
gem_server.run
$ ruby bin/gem_server.rb
Server started at http://0.0.0.0:8089
Server started at http://[::]:8089
/home/jaruga/.local/ruby-4.1.0-debug-7d4941d3e1-openssl-4.1.0-5e32b3e3fa/lib/ruby/gems/4.1.0+1/gems/rubygems-server-0.3.0/lib/rubygems/server.rb:825:in 'Gem::Server#run': uninitialized constant RDoc::Servlet (NameError)

      @server.mount '/doc_root', RDoc::Servlet, '/doc_root'
                                     ^^^^^^^^^
Did you mean?  RDoc::Server
	from bin/gem_server.rb:4:in '<main>'

Because ruby/rdoc renamed the RDoc::Servlet to RDoc::RI::Servlet at the following commit.

ruby/rdoc@3c6f5f6

@hsbt
Copy link
Copy Markdown
Member

hsbt commented May 7, 2026

@junaruga Thanks! I fixed some old issue at #15

Could you rebase from the current master branch?

This commit fixes the following error in Ruby 4.1.0dev.

gem_server.rb
```
require 'rubygems/server'

gem_server = Gem::Server.new Gem.dir, 8089, false
gem_server.run
```

```
$ ruby gem_server.rb
Server started at http://0.0.0.0:8089
Server started at http://[::]:8089
/home/jaruga/.local/ruby-4.1.0-debug-7d4941d3e1-openssl-4.1.0-5e32b3e3fa/lib/ruby/gems/4.1.0+1/gems/rubygems-server-0.3.0/lib/rubygems/server.rb:825:in 'Gem::Server#run': uninitialized constant RDoc::Servlet (NameError)

      @server.mount '/doc_root', RDoc::Servlet, '/doc_root'
                                     ^^^^^^^^^
Did you mean?  RDoc::Server
	from gem_server.rb:4:in '<main>'
```

Because ruby/rdoc renamed the `RDoc::Servlet` to `RDoc::RI::Servlet` at the
following commit.

ruby/rdoc@3c6f5f6
@junaruga junaruga force-pushed the wip/fix-rdoc-servlet branch from b2a4a5e to 39bf0e1 Compare May 7, 2026 21:18
@junaruga
Copy link
Copy Markdown
Member Author

junaruga commented May 7, 2026

Could you rebase from the current master branch?

@hsbt Thank you for working on this PR. I rebasd the PR on the current master branch, and tested the above gem_server.rb in the cases Ruby 4.1 dev with RDoc::RI::Servlet and Ruby 4.0 with RDoc::Servlet again. The command log is below.

$ ~/.local/ruby-4.1.0-debug-7d4941d3e1-openssl-4.1.0-5e32b3e3fa/bin/ruby -I ~/git/rubygems/rubygems-server/lib gem_server.rb
Server started at http://0.0.0.0:8089
Server started at http://[::]:8089
$ ~/.local/ruby-4.0.0-debug/bin/ruby -I ~/git/rubygems/rubygems-server/lib gem_server.rb
Server started at http://0.0.0.0:8089
Server started at http://[::]:8089

@hsbt hsbt merged commit c91f0c7 into ruby:master May 8, 2026
6 checks passed
@junaruga junaruga deleted the wip/fix-rdoc-servlet branch May 9, 2026 07:48
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 this pull request may close these issues.

'Gem::Server#run': uninitialized constant RDoc::Servlet (NameError) in Ruby 4.1.0dev

2 participants