`rubocop --version` crashes on fresh ruby environment

Bug #1960076 reported by Fletcher Porter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
rubocop (Ubuntu)
New
Undecided
Unassigned

Bug Description

After purging my ruby environment

```
sudo gem uninstall $(gem list --installed --no-versions)
sudo apt remove ruby* rubocop rake --yes
sudo apt autoremove --yes
sudo apt purge --yes
dpkg --list | grep ruby > /dev/null
if [ $? -eq 1 ]; then echo "no more ruby"; fi
```

And installing rubocop

```
sudo apt install rubocop ruby ruby-full
```

I get this error.

```
$ rubocop --version
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated
Traceback (most recent call last):
 10: from /usr/bin/rubocop:6:in `<main>'
  9: from /usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:85:in `require'
  8: from /usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:85:in `require'
  7: from /usr/lib/ruby/vendor_ruby/rubocop.rb:14:in `<top (required)>'
  6: from /usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:85:in `require'
  5: from /usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:85:in `require'
  4: from /usr/lib/ruby/vendor_ruby/unicode/display_width.rb:2:in `<top (required)>'
  3: from /usr/lib/ruby/vendor_ruby/unicode/display_width.rb:2:in `require_relative'
  2: from /usr/lib/ruby/vendor_ruby/unicode/display_width/index.rb:3:in `<top (required)>'
  1: from /usr/lib/ruby/vendor_ruby/unicode/display_width/index.rb:4:in `<module:Unicode>'
/usr/lib/ruby/vendor_ruby/unicode/display_width/index.rb:5:in `<module:DisplayWidth>': undefined method `gunzip' for Gem:Module (NoMethodError)
```

The exit code was 1.

This error appears to be related to [this PR](https://github.com/janlelis/unicode-display_width/pull/15) where `Gem.gunzip` was replaced with `Gem::Util.gunzip`.

The warnings at the beginning of the output seem related to [this issue](https://github.com/rubygems/rubygems/issues/4702), though I don't think they are of consequence for this bug (but they are annoying).

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: rubocop 0.52.1+dfsg-1
Uname: Linux 5.10.0-051000-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.27
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Fri Feb 4 12:57:53 2022
InstallationDate: Installed on 2021-01-04 (395 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
PackageArchitecture: all
SourcePackage: rubocop
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Fletcher Porter (fpdotmonkey) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.