Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Gem.load_plugins loads same plugin multiple times from different Gem.path entries

Aperta
#9,945 0 commenti 2 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
ruby
Ambito
backend

Direzione di ricerca

Start by reading Gem.load_plugins and the linked RDoc discussion at https://github.com/ruby/rdoc/issues/1609#issuecomment-5783667382. The issue leaves open how to choose among duplicate plugins, which version should win, and whether to report duplicates. Done means agreeing on those behaviors and ensuring one plugin is loaded per gem under the selected rules.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Posting a discussion as suggested by @tompng in https://github.com/ruby/rdoc/issues/1609#issuecomment-5783667382

Problem

When the same gem is installed in multiple directories in Gem.path, RubyGems loads its plugin once per directory rather than once per gem.

Possible fix

RubyGems should load at most one plugin for a given gem name.

Gem.load_plugins could deduplicate plugins by gem name and select the plugin associated with the activated gem specification, or otherwise apply RubyGems’ normal gem-selection rules.

Questions for community and maintainers:

  • Should deduplication be based on gem name, activated specification, or plugin path?
  • Which version should provide the plugin when multiple versions are installed?
  • Should duplicate plugin files generate a diagnostic?
  • Are there compatibility concerns with changing plugin-loading behavior?

Elaboration

For example:

/opt/homebrew/lib/ruby/gems/4.0.0
/opt/homebrew/Cellar/ruby/4.0.7/lib/ruby/gems/4.0.0

Both contain RDoc, including its RubyGems plugin:

plugins/rdoc_plugin.rb

RubyGems loads both plugin files, producing warnings such as:

warning: already initialized constant RDoc::VERSION

RDoc is the only bundled gem currently shipping a RubyGems plugin, so it is the only bundled gem exposing the problem.

Pinning RDoc does not solve the underlying issue: the warning also occurs when different RDoc versions are installed, and potentially when the same version exists in multiple locations.

Lingua principale
Ruby
Stelle
4k
Fork
1.9k
Merge medio
1g 4h
PR unite (30g)
36

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ruby/rubygems

Tutte le issue di ruby/rubygems

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.