Despite of https://rubyreferences.github.io/rubyref/stdlib/bundled.html not listing did_you_mean any more it is still bundled in ruby_2_7, see https://github.com/ruby/ruby/tree/ruby_2_7/lib By listing it under PDEPEND the gem is installed twice causing "already initialized constant" warnings when used. Reproducible: Always
Think I wrote nonsense above, but I'm not an ruby expert. As I understand it now did_you_mean is not bundled but included in /lib. So the solution would be to remove it from the DEPENDS at all. Am I right?
So, now I learned did_you_mean was promoted to a default gem. See https://bugs.ruby-lang.org/issues/16363
Bump! I have a problem too: /did_you_mean/version.rb:2: warning: already initialized constant DidYouMean::VERSION /gems/did_you_mean-1.4.0/lib/did_you_mean/version.rb:2: warning: previous definition of VERSION was here /did_you_mean/jaro_winkler.rb:63: warning: already initialized constant DidYouMean::JaroWinkler::WEIGHT /gems/did_you_mean-1.4.0/lib/did_you_mean/jaro_winkler.rb:63: warning: previous definition of WEIGHT was here /did_you_mean/jaro_winkler.rb:64: warning: already initialized constant DidYouMean::JaroWinkler::THRESHOLD /gems/did_you_mean-1.4.0/lib/did_you_mean/jaro_winkler.rb:64: warning: previous definition of THRESHOLD was here /did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb:9: warning: already initialized constant DidYouMean::VariableNameChecker::NAMES_TO_EXCLUDE /gems/did_you_mean-1.4.0/lib/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb:9: warning: previous definition of NAMES_TO_EXCLUDE was here /did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb:25: warning: already initialized constant DidYouMean::VariableNameChecker::RB_RESERVED_WORDS /gems/did_you_mean-1.4.0/lib/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb:25: warning: previous definition of RB_RESERVED_WORDS was here /did_you_mean/spell_checkers/name_error_checkers.rb:5: warning: already initialized constant DidYouMean::NameErrorCheckers /gems/did_you_mean-1.4.0/lib/did_you_mean/spell_checkers/name_error_checkers.rb:5: warning: previous definition of NameErrorCheckers was here /did_you_mean/spell_checkers/method_name_checker.rb:7: warning: already initialized constant DidYouMean::MethodNameChecker::NAMES_TO_EXCLUDE /gems/did_you_mean-1.4.0/lib/did_you_mean/spell_checkers/method_name_checker.rb:7: warning: previous definition of NAMES_TO_EXCLUDE was here /did_you_mean/spell_checkers/method_name_checker.rb:20: warning: already initialized constant DidYouMean::MethodNameChecker::RB_RESERVED_WORDS /gems/did_you_mean-1.4.0/lib/did_you_mean/spell_checkers/method_name_checker.rb:20: warning: previous definition of RB_RESERVED_WORDS was here /did_you_mean.rb:87: warning: already initialized constant DidYouMean::SPELL_CHECKERS /gems/did_you_mean-1.4.0/lib/did_you_mean.rb:87: warning: previous definition of SPELL_CHECKERS was here
I have the same issue. % equery b /usr/lib64/ruby/gems/2.7.0/gems/did_you_mean-1.5.0/lib/did_you_mean/version.rb * Searching for /usr/lib64/ruby/gems/2.7.0/gems/did_you_mean-1.5.0/lib/did_you_mean/version.rb ... dev-ruby/did_you_mean-1.5.0 (/usr/lib64/ruby/gems/2.7.0/gems/did_you_mean-1.5.0/lib/did_you_mean/version.rb) % equery b /usr/lib64/ruby/2.7.0/did_you_mean/version.rb * Searching for /usr/lib64/ruby/2.7.0/did_you_mean/version.rb ... dev-lang/ruby-2.7.2 (/usr/lib64/ruby/2.7.0/did_you_mean/version.rb)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e225cca1aa95b8a5e54cbd855f17dbaf88940d9 commit 2e225cca1aa95b8a5e54cbd855f17dbaf88940d9 Author: Hans de Graaff <graaff@gentoo.org> AuthorDate: 2021-03-13 11:06:44 +0000 Commit: Hans de Graaff <graaff@gentoo.org> CommitDate: 2021-03-13 14:00:29 +0000 dev-lang/ruby: properly remove default gems In Gentoo we always expect the default gems to be present as gems, and the default gems need to be removed to avoid duplicate definitions in code that does not explicitly require the gem. json and did_you_mean were not or only partially removed. Closes: https://bugs.gentoo.org/758464 Package-Manager: Portage-3.0.13, Repoman-3.0.2 Signed-off-by: Hans de Graaff <graaff@gentoo.org> dev-lang/ruby/ruby-2.6.6-r3.ebuild | 259 ++++++++++++++++++++++++++++++++++++ dev-lang/ruby/ruby-2.7.2-r1.ebuild | 263 ++++++++++++++++++++++++++++++++++++ dev-lang/ruby/ruby-3.0.0-r2.ebuild | 264 +++++++++++++++++++++++++++++++++++++ 3 files changed, 786 insertions(+)