Closed ojab closed 4 years ago
Can you also check RUBYOPT
and RUBYLIB
?
Empty on both runs.
Coulld you run ruby -e "require 'did_you_mean'; puts $LOADED_FEATURES.grep(/did_you_mean\.rb/)"
?
Traceback (most recent call last):
-e:1:in `<main>': undefined method `grep' for nil:NilClass (NoMethodError)
If I run it from irb:
irb(main):001:0> require 'did_you_mean'; puts $LOADED_FEATURES.grep(/did_you_mean\.rb/)
/usr/share/gems/gems/did_you_mean-1.4.0/lib/did_you_mean.rb
=> nil
So if you run $ gem list | grep default
, did_you_mean
is not there, right?
It sounds like your ruby distribution doesn't ship did_you_mean
as a default gem, nor as a default library, and ruby pretty much expects this.
How did you install ruby?
As a workaround, I guess you could try RUBYOPT=--disable-did_you_mean
.
Basically ruby is built from this spec. So after a bit of googling I've found https://github.com/ruby/did_you_mean/issues/117#issuecomment-482733159 and looks like https://github.com/ruby/ruby/commit/171803d5d34feb1b4244ca81b9db0a7bc2171c85 should've made it default gem, but somehow it's not in fedora's 2.7.0. Thanks for the help, I'll open a bug in fedora bugtracker.
Great, thanks.
I guess we could avoid loading did_you_mean
here like:
diff --git a/lib/rubygems/ext/ext_conf_builder.rb b/lib/rubygems/ext/ext_conf_builder.rb
index 88be7ecfe8..0f9d40210a 100644
--- a/lib/rubygems/ext/ext_conf_builder.rb
+++ b/lib/rubygems/ext/ext_conf_builder.rb
@@ -40,7 +40,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
destdir = ENV["DESTDIR"]
begin
- cmd = Gem.ruby.shellsplit << "-I" << File.expand_path("../../..", __FILE__) <<
+ cmd = Gem.ruby.shellsplit << "--disable-did_you_mean" << "-I" << File.expand_path("../../..", __FILE__) <<
"-r" << get_relative_path(siteconf.path) << File.basename(extension)
cmd.push(*args)
But still Fedora should probably change this.
I'm pretty sure they are already aware though, since they proposed https://github.com/ruby/ruby/pull/2764 to ruby-core.
Oh, good. Then I workaround it in our images for the time being.
I have strange issue with
bundle install
: we have centos-7 docker image with ruby built from fedora specs and it works perfectly fine with ruby-2.6.5 & bundler-2.1.2. With ruby-2.7.0 installation of any gem with native extension fails with`--verbose` output:
``` $ bundle --path=.bundle --verbose Running `bundle install --path ".bundle" --verbose` with bundler 2.1.4 Found changes from the lockfile, re-resolving dependencies because the list of sources changed, the dependencies in your gemfile changed, you added a new platform to your gemfile HTTP GET https://index.rubygems.org/versions HTTP 206 Partial Content https://index.rubygems.org/versions Fetching gem metadata from https://rubygems.org/ Looking up gems ["pg"] Looking up gems ["rake-compiler"] Looking up gems ["rake"] Resolving dependencies... Using bundler 2.1.4 0: bundler (2.1.4) from /usr/local/share/gems/specifications/bundler-2.1.4.gemspec Fetching pg 1.2.2 Installing pg 1.2.2 with native extensions Building native extensions with: '--with-pg-config=/usr/pgsql-11/bin/pg_config' This could take a while... Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /tmp/testapp/.bundle/ruby/2.7.0/gems/pg-1.2.2/ext /usr/bin/ruby -I /usr/share/rubygems -r ./siteconf20200217-201-1r8tqhb.rb extconf.rb --with-pg-config\=/usr/pgsql-11/bin/pg_config /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- did_you_mean (LoadError) from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:92:in `require' fromeven though
did_you_mean
gem is installed andIf I set debugger @
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:92
—did_you_mean
is actually required twice and first time it's required just ok, only second time fails.BUNDLER
envvars are empty first time, second time it isAny hints how to fix/debug it are welcome.