Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 780897 - dev-lang/ruby-2.7.3 - does not install base gem files
Summary: dev-lang/ruby-2.7.3 - does not install base gem files
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal with 2 votes (vote)
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-07 21:06 UTC by Carel
Modified: 2021-08-07 15:35 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge --info,5.59 KB, text/plain)
2021-04-07 21:06 UTC, Carel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Carel 2021-04-07 21:06:35 UTC
Created attachment 698313 [details]
emerge --info

Problem
=======

The Ruby 2.7.3 E-build, and potentially the 2.7.2-r1 E-build, do not install the base Gem files.

Observations
============

While trying to build www-apps/gitlabhq-13.8.2 from the Gitlab overlay on an AMD64 system I encountered various installation and run time issues with Ruby reporting `LoadError` for various Gems. 

  * I could install the package with Ruby26, selected through `eselect`, but I could not get it running on This version. The package itself run to a degree with Ruby27, again selected through eselect, but parts of the application would die reporting `LoadError` most commonly this occurs with `dev-ruby/do_you_mean` but other gem files also fail in this way.

  * Initially I had Ruby25, Ruby 26, Ruby27 and Ruby30 enabled to ease the upgrade of GitlabHQ. Clamping my installation to Ruby27 would also trigger a `LoadError` especially when installing `dev-ruby/did_you_mean` but again this was also seen with other Ruby Gems.

A similar scenario was reported upon the Gentoo forums https://forums.gentoo.org/viewtopic-p-8587719.html?sid=e8d56654c8ced858ccaedf8f8dfcb74b. According to the forum one should reinstall the Ruby Gems package, dev-ruby/rubygems AND/OR virtual/rubygems. This fails again, in my case and again `LoadError` is reported for various packages, since the paths `/usr/lib64/ruby/site_ruby/2.7.0/{auto_gem.rb,rubygems/,rubygems.rb}` are missing. This seems to be the cause for all the `LoadError` whether a package is being installed or executed. 

After cleaning up my Ruby installation, as described below, and clamping it to Ruby27, specifically ruby-2.7.2, I seem to resolve the issue; that is `/usr/lib64/ruby/site_ruby/2.7.0/{auto_gem.rb,rubygems/,rubygems.rb}` are properly populated.

Investigation
=============

Adapting the steps reported in the forum, to target specific Ruby packages, I was able to explicitly test particular versions of the Ruby E-build(s) :

 * Unmerge ruby, dev-lang/ruby*, and its associated packages, dev-ruby/*, along with the Ruby Gems, virtual/rubygems, and selection utility, app-eselect/eselect-ruby.

     emerge -Ca dev-lang/ruby* dev-ruby/*  virtual/rubygem* app-eselect/eselect-ruby*

 * Unmask the desired version of Ruby in /etc/portage/profile/use.stable.mask

     -ruby_targets_ruby27

 * Specify the Ruby target(s) in /etc/portage/make.conf

     RUBY_TARGETS="ruby27"

 * Include the desired ruby version /etc/portage/package.unmask

     =dev-lang/ruby-2.7.2 # This is not strictly necesary

 * Exclude all other ruby versions /etc/portage/package.mask

     <=dev-lang/ruby-2.7.1
     >=dev-lang/ruby-2.7.2-r2

 * Enable AMD64 builds in /etc/portage/package.accept_keywords

     dev-lang/ruby ~amd64
     =dev-lang/ruby-2.7.2 ~amd64
     virtual/rubygems ~amd64
     dev-ruby/rubygems ~amd64
     dev-ruby/PACKAGE ~amd64 # (PACKAGE=bundler,did_you_mean,json,racc,rake,...)

 * Enable any additional flags in /etc/portage/package.use. (Note: Usually setting such flags implies something in the previous step(s) is not 100%)

     dev-ruby/PACKAGE ruby_targets_rubyXX

 * Merge in the Ruby configuration 

     emerge dev-lang/ruby

In particular the E-build for Ruby 2.7.2 populates the paths, `/usr/lib64/ruby/site_ruby/2.7.0/{auto_gem.rb,rubygems/,rubygems.rb}`, while the E-build for Ruby 2.7.3 does not. The 2.7.3 and 2.7.2-r1 E-builds are identical content and both appear to fail for AMD64.

I have included my ``emerge --info`` for the working setup and will happily furnish any additional information should it be useful.

Resolution
==========

My understanding is that on AMD64 systems the Ruby E-builds (2.7.2-r1 and 2.7.3) are not populating the appropriate paths with the included Gems.

Unfortunately I'm not especially familiar with Ruby and cannot offer a comprehensive solution. Controlling the installation to the degree illustrated above does seem to work however.
Comment 1 Michael Pyne 2021-08-07 15:09:15 UTC
I think I've run into this as well. I need Ruby 2 to use Jekyll with Github Pages and with 2.7.4 I ran into a bunch of errors installing gems along the lines of:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/home/user/projects/personal/vendor/bundle/ruby/2.7.0/gems/commonmarker-0.17.13/ext/commonmarker
/usr/bin/ruby27 -I /usr/lib64/ruby/site_ruby/2.7.0 -r ./siteconf20210807-196262-kncpi3.rb extconf.rb
/usr/lib64/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require': cannot load such file -- did_you_mean (LoadError)
        from /usr/lib64/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
        from <internal:gem_prelude>:2:in `<internal:gem_prelude>'


I also had Ruby 2.6 installed and when I forced use of Ruby 2.6 instead it worked.

The Portage tree no longer has any version of Ruby 2.7 besides 2.7.4 so I'm unable to test whether 2.7.1 would work.
Comment 2 Sam James archtester gentoo-dev Security 2021-08-07 15:35:47 UTC
Could somebody hitting this try to grab the build.log (and provide emerge —-info)?