[DRE-maint] Bug#895946: rake: LoadError from Get::Ext::RakeBuilder trying to find rake
Martin Dorey
martin.dorey at hitachivantara.com
Tue Apr 17 18:40:49 BST 2018
Package: rake
Version: 10.5.0-2
Severity: normal
Dear Maintainer,
Installing a gem that contains mkrf_conf, for example the three year old "beta"
of unf, causes rubygems/ext/builder.rb to take its RakeBuilder code path,
rather than, for example, the ExtConfBuilder path that the last "release" version
of unf uses. This RakeBuilder path, at least in Stretch's rubygems, doesn't work
with Debian's rake package, even 12.3.1-1 from Buster, failing like this:
martind at balance:/tmp$ sudo gem install --no-ri --no-rdoc --prerelease unf
Fetching: unf-0.2.0.beta2.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing unf:
ERROR: Failed to build gem native extension.
current directory: /newvar/lib/gems/2.3.0/gems/unf-0.2.0.beta2/ext
/usr/bin/ruby2.3 mkrf_conf.rb
current directory: /newvar/lib/gems/2.3.0/gems/unf-0.2.0.beta2/ext
/usr/bin/ruby2.3 -rubygems /usr/share/rubygems-integration/all/gems/rake-10.5.0/bin/rake RUBYARCHDIR=/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/unf-0.2.0.beta2 RUBYLIBDIR=/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/unf-0.2.0.beta2
/usr/bin/ruby2.3: No such file or directory -- /usr/share/rubygems-integration/all/gems/rake-10.5.0/bin/rake (LoadError)
rake failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.3.0/gems/unf-0.2.0.beta2 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/unf-0.2.0.beta2/gem_make.out
martind at balance:/tmp$
The RakeBuilder code path, visible early in:
https://github.com/rubygems/rubygems/blob/master/lib/rubygems/ext/rake_builder.rb
... tries to run rake from Gem.bin_path("rake", "rake"). That's:
martind at balance:~$ ruby -we 'puts(Gem.bin_path("rake", "rake"))'
/usr/share/rubygems-integration/all/gems/rake-10.5.0/bin/rake
martind at balance:~$
But the rake package only installs the binary as /usr/bin/rake.
That (upstream) source reveals a work-around: setting an environment variable,
"rake", to point to /usr/bin/rake.
That works for me.
Installing a later rake gem, with sudo gem install rake, as promoted by eg:
https://askubuntu.com/questions/872399/error-failed-to-build-gem-native-extension-when-trying-to-download-rubocop
... works too, but presumably the Debian package should work.
Perhaps you'd rather tackle this as an issue with the rubygems package.
It was just my guess that it would be less intrusive to tackle in rake.
-- System Information:
Debian Release: 9.3
APT prefers stable-updates
APT policy: (990, 'stable-updates'), (990, 'stable'), (500, 'oldstable-updates'), (500, 'oldoldstable-updates'), (500, 'oldoldstable'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.9.0-5-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages rake depends on:
ii ruby 1:2.3.3
ii ruby1.8 [ruby-interpreter] 1.8.7.358-7.1+deb7u5
ii ruby1.9.1 [ruby-interpreter] 1.9.3.194-8.1+deb7u7
ii ruby2.1 [ruby-interpreter] 2.1.5-2+deb8u3
Versions of packages rake recommends:
ii zip 3.0-11+b1
rake suggests no packages.
-- no debconf information
More information about the Pkg-ruby-extras-maintainers
mailing list