Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 728210

Summary: dev-ruby/racc-1.4.16-r1 - /usr/lib64/ruby/2.4.0/rubygems.rb:17:in `require': cannot load such file -- rubygems/compatibility (LoadError)
Product: Gentoo Linux Reporter: Anton Gubarkov <anton.gubarkov>
Component: Current packagesAssignee: Gentoo Ruby Team <ruby>
Status: UNCONFIRMED ---    
Severity: normal CC: cctsurf, dominik, hlein, lssndrbarbieri, sarnex
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Anton Gubarkov 2020-06-14 09:59:55 UTC
>>> Emerging (28 of 201) dev-ruby/racc-1.4.16-r1::gentoo
 * racc-1.4.16.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                                                                  [ ok ]
>>> Unpacking source...
 * Running unpack phase for all ...
>>> Unpacking racc-1.4.16.tar.gz to /var/tmp/portage/dev-ruby/racc-1.4.16-r1/work/all
>>> Source unpacked in /var/tmp/portage/dev-ruby/racc-1.4.16-r1/work
>>> Preparing source in /var/tmp/portage/dev-ruby/racc-1.4.16-r1/work ...
 * Running prepare phase for all ...
 * Running prepare phase for all ...
/usr/lib64/ruby/2.4.0/rubygems.rb:17:in `require': cannot load such file -- rubygems/compatibility (LoadError)
	from /usr/lib64/ruby/2.4.0/rubygems.rb:17:in `<top (required)>'
	from <internal:gem_prelude>:4:in `require'
	from <internal:gem_prelude>:4:in `<internal:gem_prelude>'
Comment 1 Anton Gubarkov 2020-06-14 10:00:36 UTC
home64 ~ # emerge --info =dev-ruby/racc-1.4.16-r1
Portage 2.3.100 (python 3.7.7-final-0, default/linux/amd64/17.1/desktop/gnome/systemd, gcc-9.3.0, glibc-2.31-r5, 5.7.0-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.7.0-gentoo-x86_64-Intel-R-_Core-TM-_i5-8600K_CPU_@_3.60GHz-with-gentoo-2.7
KiB Mem:    15882004 total,   8942516 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Sun, 14 Jun 2020 08:35:26 +0000
Head commit of repository gentoo: 0048174518823ee76686ef7e545b148551767081

sh bash 5.0_p17
ld GNU ld (Gentoo 2.32 p2) 2.32.0
app-shells/bash:          5.0_p17::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.30.3-r1::gentoo
dev-lang/python:          2.7.18::gentoo, 3.6.10-r2::gentoo, 3.7.7-r2::gentoo, 3.8.3::gentoo, 3.9.0_beta3::gentoo
dev-util/cmake:           3.17.3::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.2::gentoo
sys-devel/binutils:       2.32-r1::gentoo, 2.33.1-r1::gentoo, 2.34-r1::gentoo
sys-devel/gcc:            8.3.0-r3::gentoo, 8.4.0-r1::gentoo, 9.2.0-r4::gentoo, 9.3.0::gentoo, 10.1.0-r1::gentoo
sys-devel/gcc-config:     2.3::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.7::gentoo (virtual/os-headers)
sys-libs/glibc:           2.31-r5::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000

go-overlay
    location: /var/lib/layman/go-overlay
    masters: gentoo
    priority: 50

java
    location: /var/lib/layman/java
    masters: gentoo
    priority: 50

steam-overlay
    location: /var/lib/layman/steam-overlay
    masters: gentoo
    priority: 50

wsdd
    location: /var/lib/layman/wsdd
    masters: gentoo
    priority: 50

rugubara
    location: /var/lib/layman/rugubara
    masters: gentoo
    priority: 100

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -mtune=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -mtune=native"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe -mtune=native"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -mtune=native"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi aio alsa amd64 berkdb bluetooth branding bzip2 cacert cairo cdda cdr cgroup-hybrid cli client colord crypt cups cycles dbus djvu dri dri3 drm dts dvd dvdr eds emboss encode evo exif fat ffmpeg fftw firewalld flac fortran gdbm gif gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk iconv icu introspection ipv6 jack javafx jpeg jpeg2k lcms ldap libglvnd libnotify libsecret libtirpc libzfs lm_sensors lv2 mad mng mp3 mp4 mpeg mtp multilib native-headset nautilus ncat ncurses networkmanager nls nptl nvenc nvme ogg opengl openimageio openmp opus pam pango pcre pdf png policykit ppds pulseaudio qt5 raw readline samba script sdl sdl2 seccomp smp sna sound spell spice split-usr ssl startup-notification svg systemd tcpd thunderbolt tiff tracker truetype udev udisks uefi unicode upower usb usbredir user-session vaapi vala virgl virt-network vorbis wxwidgets x264 x265 xattr xcb xml xv xvid zeroconf zfs zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en ru" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby25 ruby27" USERLAND="GNU" VIDEO_CARDS="intel i965 iris nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

dev-ruby/racc-1.4.16-r1::gentoo was built with the following:
USE="-doc -test" ABI_X86="(64)" RUBY_TARGETS="(ruby24) ruby25 ruby27 -ruby26"
FEATURES="usersync fixlafiles ipc-sandbox config-protect-if-modified unmerge-orphans preserve-libs sfperms multilib-strict distlocks assume-digests parallel-fetch usersandbox binpkg-docompress binpkg-logs network-sandbox userfetch userpriv merge-sync ebuild-locks protect-owned qa-unresolved-soname-deps unmerge-logs pid-sandbox binpkg-dostrip sandbox strict news unknown-features-warn xattr"
Comment 2 Anton Gubarkov 2020-06-14 10:01:18 UTC
build.log:

 * Package:    dev-ruby/racc-1.4.16-r1
 * Repository: gentoo
 * Maintainer: ruby@gentoo.org
 * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux ruby_targets_ruby25 ruby_targets_ruby27 userland_GNU
 * FEATURES:   network-sandbox preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
 * Running unpack phase for all ...
>>> Unpacking racc-1.4.16.tar.gz to /var/tmp/portage/dev-ruby/racc-1.4.16-r1/work/all
>>> Source unpacked in /var/tmp/portage/dev-ruby/racc-1.4.16-r1/work
>>> Preparing source in /var/tmp/portage/dev-ruby/racc-1.4.16-r1/work ...
 * Running prepare phase for all ...
 * Running prepare phase for all ...
/usr/lib64/ruby/2.4.0/rubygems.rb:17:in `require': cannot load such file -- rubygems/compatibility (LoadError)
        from /usr/lib64/ruby/2.4.0/rubygems.rb:17:in `<top (required)>'
        from <internal:gem_prelude>:4:in `require'
        from <internal:gem_prelude>:4:in `<internal:gem_prelude>'
 * ERROR: dev-ruby/racc-1.4.16-r1::gentoo failed (prepare phase):
 *   (no error message)
 *
 * Call stack:
 *     ebuild.sh, line  125:  Called src_prepare
 *   environment, line 2139:  Called ruby-ng_src_prepare
 *   environment, line 1795:  Called _ruby_invoke_environment 'all' '_ruby_apply_patches'
 *   environment, line  698:  Called _ruby_apply_patches
 *   environment, line  537:  Called all_ruby_prepare
 *   environment, line  796:  Called die
 * The specific snippet of code:
 *       rake lib/racc/parser-text.rb || die;
 *
 * If you need support, post the output of `emerge --info '=dev-ruby/racc-1.4.16-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-ruby/racc-1.4.16-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-ruby/racc-1.4.16-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-ruby/racc-1.4.16-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-ruby/racc-1.4.16-r1/work/all/racc-1.4.16'
 * S: '/var/tmp/portage/dev-ruby/racc-1.4.16-r1/work/all/racc-1.4.16'
Comment 3 Anton Gubarkov 2020-06-14 10:02:13 UTC
This package blocks @world update for me as:

 * One or more packages are either masked or have missing dependencies:
 *
 *   >=dev-ruby/minitest-5.10.1[ruby_targets_ruby24] pulled in by:
 *     (dev-lang/ruby-2.4.10:2.4/2.4::gentoo, installed)
 *
 *   virtual/rubygems[ruby_targets_ruby24(-)] pulled in by:
 *     (dev-ruby/did_you_mean-1.1.2:2.4/2.4::gentoo, installed)
 *
 *   virtual/ruby-ssl[ruby_targets_ruby24(-)] pulled in by:
 *     (dev-ruby/racc-1.4.16-r1:0/0::gentoo, installed)
 *
 * The resume list contains packages that are either masked or have
 * unsatisfied dependencies. Please restart/continue the operation
 * manually, or use --skipfirst to skip the first package in the list and
 * any other packages that may be masked or have missing dependencies.
 *
 * The following package has failed to build, install, or execute postinst:
 *
 *  (dev-ruby/racc-1.4.16-r1:0/0::gentoo, ebuild scheduled for merge), Log file:
 *   '/var/tmp/portage/dev-ruby/racc-1.4.16-r1/temp/build.log'
 *
Comment 4 Anton Gubarkov 2020-06-14 10:03:41 UTC
(In reply to Anton Gubarkov from comment #3)
> This package blocks @world update for me...

I observe this on 2 hosts
Comment 5 James 2020-06-14 23:20:44 UTC
I have this on my ~amd64 system as well.
Comment 6 James 2020-06-15 16:48:06 UTC
I fixed this by selecting ruby 2.7 I had my system set to 2.4.
Comment 7 Anton Gubarkov 2020-06-15 17:14:26 UTC
(In reply to James from comment #6)
> I fixed this by selecting ruby 2.7 I had my system set to 2.4.

worked for me as well.
Does it deserve a news item?
Comment 8 James 2020-06-15 21:25:42 UTC
(In reply to Anton Gubarkov from comment #7)
> Does it deserve a news item?

I was surprised that it didn't receive one seeing as ruby 2.4 is being deprecated.
Comment 9 ihor 2021-02-12 03:14:20 UTC
I have the same issue dev-ruby/racc-1.5.2-r1

>>> Emerging (1 of 1) dev-ruby/racc-1.5.2-r1::gentoo
 * racc-1.5.2.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                                                                                                                                                                                        [ ok ]
>>> Unpacking source...
 * Running unpack phase for all ...
>>> Unpacking racc-1.5.2.tar.gz to /var/tmp/portage/dev-ruby/racc-1.5.2-r1/work/all
>>> Source unpacked in /var/tmp/portage/dev-ruby/racc-1.5.2-r1/work
>>> Preparing source in /var/tmp/portage/dev-ruby/racc-1.5.2-r1/work ...
 * Running prepare phase for all ...
 * Running prepare phase for all ...
Traceback (most recent call last):
	3: from <internal:gem_prelude>:1:in `<internal:gem_prelude>'
	2: from <internal:gem_prelude>:1:in `require'
	1: from /usr/lib64/ruby/2.7.0/rubygems.rb:16:in `<top (required)>'
/usr/lib64/ruby/2.7.0/rubygems.rb:16:in `require': cannot load such file -- rubygems/compatibility (LoadError)
 * ERROR: dev-ruby/racc-1.5.2-r1::gentoo failed (prepare phase):
 *   (no error message)
 *
 * Call stack:
 *     ebuild.sh, line  125:  Called src_prepare
 *   environment, line 2183:  Called ruby-ng_src_prepare
 *   environment, line 1839:  Called _ruby_invoke_environment 'all' '_ruby_apply_patches'
 *   environment, line  695:  Called _ruby_apply_patches
 *   environment, line  530:  Called all_ruby_prepare
 *   environment, line  795:  Called die
 * The specific snippet of code:
 *       rake lib/racc/parser-text.rb || die;
 *
 * If you need support, post the output of `emerge --info '=dev-ruby/racc-1.5.2-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-ruby/racc-1.5.2-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-ruby/racc-1.5.2-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-ruby/racc-1.5.2-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-ruby/racc-1.5.2-r1/work/all/racc-1.5.2'
 * S: '/var/tmp/portage/dev-ruby/racc-1.5.2-r1/work/all/racc-1.5.2'

>>> Failed to emerge dev-ruby/racc-1.5.2-r1, Log file:
Comment 10 ihor 2021-02-12 03:16:02 UTC
Fix that worked for me:

# eselect ruby list
Available Ruby profiles:
  [1]   ruby26 (with Rubygems)
  [2]   ruby27 *
  [3]   ruby30 (with Rubygems)

# eselect ruby set 3
Comment 11 Hank Leininger 2021-10-08 20:45:35 UTC
I'm hitting something similar on a box trying to migrate from ruby26 to ruby27, rebuilding racc-1.5.2-r1:

# eselect ruby list
Available Ruby profiles:
  [1]   ruby26
  [2]   ruby27 (with Rubygems) *

...
>>> Emerging (109 of 230) dev-ruby/racc-1.5.2-r1::gentoo
 * racc-1.5.2.tar.gz BLAKE2B SHA512 size ;-) ...                            [ ok ]
>>> Unpacking source...
 * Running unpack phase for all ...
>>> Unpacking racc-1.5.2.tar.gz to /var/tmp/portage/dev-ruby/racc-1.5.2-r1/work/all
>>> Source unpacked in /var/tmp/portage/dev-ruby/racc-1.5.2-r1/work
>>> Preparing source in /var/tmp/portage/dev-ruby/racc-1.5.2-r1/work ...
 * Running prepare phase for all ...
 * Running prepare phase for all ...
/usr/lib64/ruby/2.6.0/rubygems.rb:16:in `require': cannot load such file -- rubygems/compatibility (LoadError)
        from /usr/lib64/ruby/2.6.0/rubygems.rb:16:in `<top (required)>'
        from <internal:gem_prelude>:2:in `require'
        from <internal:gem_prelude>:2:in `<internal:gem_prelude>'
 * ERROR: dev-ruby/racc-1.5.2-r1::gentoo failed (prepare phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line  127:  Called src_prepare
 *   environment, line 2098:  Called ruby-ng_src_prepare
 *   environment, line 1754:  Called _ruby_invoke_environment 'all' '_ruby_apply_patches'
 *   environment, line  609:  Called _ruby_apply_patches
 *   environment, line  444:  Called all_ruby_prepare
 *   environment, line  709:  Called die
 * The specific snippet of code:
 *       rake lib/racc/parser-text.rb || die;
 * 
 * If you need support, post the output of `emerge --info '=dev-ruby/racc-1.5.2-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-ruby/racc-1.5.2-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-ruby/racc-1.5.2-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-ruby/racc-1.5.2-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-ruby/racc-1.5.2-r1/work/all/racc-1.5.2'
 * S: '/var/tmp/portage/dev-ruby/racc-1.5.2-r1/work/all/racc-1.5.2'

Three other systems with nominally the same package sets and upgrade paths gave me no such problems.

I have tried (pretty much blindly, I don't grok the ruby ecosystem):

- eselect'ing back and forth between ruby26 and ruby27
- forcing rubygems and racc to include ruby26 while leaving it off for as much else as possible
- editing racc's ebuild to say only USE_RUBY="ruby27"
- turning ruby26 back on globally, rebuilding world, turning it off again, rebuilding world again (the above is from that, which is why it was a >200 long list of packages)

Always fails in basically the same way. emerge -u... world schedules rubygems for rebuild before racc, rubygems gets rebuilt w/o ruby26 support, then racc build fails with the above error.

At this point I am tempted to expunge every trace of ruby from this box, and then start over from scratch with only ruby27. Less dramatic suggestions welcome :)
Comment 12 Hank Leininger 2021-10-09 00:40:13 UTC
(In reply to Hank Leininger from comment #11)
> I'm hitting something similar on a box trying to migrate from ruby26 to
> ruby27, rebuilding racc-1.5.2-r1:
[snip]
> Always fails in basically the same way. emerge -u... world schedules
> rubygems for rebuild before racc, rubygems gets rebuilt w/o ruby26 support,
> then racc build fails with the above error.

Ugh, pebkac: some cruft from non-portage installs of ruby gems had cluttered /usr/local/bin/ on this box, and the build process was finding those (still with env ruby26 shebangs). After cleaning that up, all is well here.