I am using ruby and gem commands at a relatively latest ruby/ruby master branch ruby/ruby@7d4941d.
Summary
I created the following testing ruby script written on the README.md.
bin/gem_server.rb
gem_server = Gem::Server.new Gem.dir, 8089, false
gem_server.run
Then I got the following error. I expected that I didn't need to require the rubygem-server due to the gem plugin feature lib/rubygems_plugin.rb in this repository. But it seems it is actually required. Did you intend the testing ruby script works without require 'rubygems/server'?
$ ruby bin/gem_server.rb
bin/gem_server.rb:1:in '<main>': uninitialized constant Gem::Server (NameError)
gem_server = Gem::Server.new Gem.dir, 8089, false
^^^^^^^^
Did you mean? Gem::Resolver
Then I updated bin/gem_server.rb adding the require 'rubygems/server'.
bin/gem_server.rb
require 'rubygems/server'
gem_server = Gem::Server.new Gem.dir, 8089, false
gem_server.run
I got the following error.
$ 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>'
https://github.com/rubygems/rubygems-server/blob/55a910c18412213e960c385642f2a7dc6a98f36d/lib/rubygems/server.rb#L825
The ruby/rdoc repository renamed the RDoc::Servlet to RDoc::RI::Servlet at ruby/rdoc@3c6f5f6. So, I assume this repository need to apply the RDoc::RI::Servlet or RDoc::Servlet conditionally. Or add the compatible RDoc::Servlet class being alias of the RDoc::RI::Servlet to ruby/rdoc.
My environment
$ which ruby
~/.local/ruby-4.1.0-debug-7d4941d3e1-openssl-4.1.0-5e32b3e3fa/bin/ruby
$ ruby -v
ruby 4.1.0dev (2026-04-23T04:48:32Z master 7d4941d3e1) +PRISM [x86_64-linux]
$ which gem
~/.local/ruby-4.1.0-debug-7d4941d3e1-openssl-4.1.0-5e32b3e3fa/bin/gem
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 4.1.0.dev
- RUBY VERSION: 4.1.0 (2026-04-23 patchlevel -1) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/jaruga/.local/ruby-4.1.0-debug-7d4941d3e1-openssl-4.1.0-5e32b3e3fa/lib/ruby/gems/4.1.0+1
- USER INSTALLATION DIRECTORY: /home/jaruga/.local/share/gem/ruby/4.1.0+1
- CREDENTIALS FILE: /home/jaruga/.local/share/gem/credentials
- RUBY EXECUTABLE: /home/jaruga/.local/ruby-4.1.0-debug-7d4941d3e1-openssl-4.1.0-5e32b3e3fa/bin/ruby
- GIT EXECUTABLE: /bin/git
- EXECUTABLE DIRECTORY: /home/jaruga/.local/ruby-4.1.0-debug-7d4941d3e1-openssl-4.1.0-5e32b3e3fa/bin
- SPEC CACHE DIRECTORY: /home/jaruga/.cache/gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /home/jaruga/.local/ruby-4.1.0-debug-7d4941d3e1-openssl-4.1.0-5e32b3e3fa/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/jaruga/.local/ruby-4.1.0-debug-7d4941d3e1-openssl-4.1.0-5e32b3e3fa/lib/ruby/gems/4.1.0+1
- /home/jaruga/.local/share/gem/ruby/4.1.0+1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => true
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /home/jaruga/.local/ruby-4.1.0-debug-7d4941d3e1-openssl-4.1.0-5e32b3e3fa/bin
- /usr/local/wasmtime-1.0.1/bin
- /home/jaruga/.go/bin
- /home/jaruga/git/gem2rpm/bin
- /home/jaruga/git/rpmlint/dist/usr/bin
- /bin
- /usr/bin
- /usr/sbin
- /usr/local/bin
- /usr/local/sbin
- /home/jaruga/bin
- /home/jaruga/.local/bin
- /home/jaruga/.local/FASTK-f18a4e6/bin
- /home/jaruga/.local/GENESCOPE.FK-380815c/bin
- /home/jaruga/.local/MERQURY.FK-8f3ab70/bin
- /var/lib/snapd/snap/bin
- /usr/local/powercap/bin
- /usr/local/mongodb-linux-x86_64-rhel80-4.4.1/bin
- /home/jaruga/.npm-global/bin
$ gem info rubygems-server
*** LOCAL GEMS ***
rubygems-server (0.3.0)
Author: Hiroshi SHIBATA
Homepage: https://github.com/rubygems/rubygems-server
License: MIT
Installed at: /home/jaruga/.local/ruby-4.1.0-debug-7d4941d3e1-openssl-4.1.0-5e32b3e3fa/lib/ruby/gems/4.1.0+1
Gem::Server and allows users to serve gems for consumption by `gem
--remote-install`.
I am using
rubyandgemcommands at a relatively latest ruby/ruby master branch ruby/ruby@7d4941d.Summary
I created the following testing ruby script written on the
README.md.bin/gem_server.rb
Then I got the following error. I expected that I didn't need to require the rubygem-server due to the gem plugin feature
lib/rubygems_plugin.rbin this repository. But it seems it is actually required. Did you intend the testing ruby script works withoutrequire 'rubygems/server'?Then I updated
bin/gem_server.rbadding therequire 'rubygems/server'.bin/gem_server.rb
I got the following error.
https://github.com/rubygems/rubygems-server/blob/55a910c18412213e960c385642f2a7dc6a98f36d/lib/rubygems/server.rb#L825
The ruby/rdoc repository renamed the
RDoc::ServlettoRDoc::RI::Servletat ruby/rdoc@3c6f5f6. So, I assume this repository need to apply theRDoc::RI::ServletorRDoc::Servletconditionally. Or add the compatibleRDoc::Servletclass being alias of theRDoc::RI::Servletto ruby/rdoc.My environment