Brew broken after git gc, prof install, and cleanup

#1

I was trying to figure out why brew search ssl was being slow, found someone suggest running git gc, so I did that inside /usr/local/Homebrew and got:

Counting objects: 119758, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (30910/30910), done.
Writing objects: 100% (119758/119758), done.
Total 119758 (delta 87710), reused 117850 (delta 85880)

That didn’t seem to help, so I found someone suggest using the prof option, and I ran brew prof search ssl. I got this:

==> Installing 'ruby-prof' gem
Fetching: ruby-prof-0.17.0.gem (100%)
Building native extensions.  This could take a while...
Successfully installed ruby-prof-0.17.0
1 gem installed

and then the search results with no other output. I ran it again thinking maybe the prof install made it not do the prof correctly. I got just the search results. So I decided I didn’t know how to use prof and ran brew help prof and got this:

Error: uninitialized constant Homebrew::CLI
Did you mean?  CGI
Please report this bug:
  https://docs.brew.sh/Troubleshooting
/usr/local/Homebrew/Library/Homebrew/dev-cmd/prof.rb:5:in `prof_args'
/usr/local/Homebrew/Library/Homebrew/help.rb:82:in `command_help'
/usr/local/Homebrew/Library/Homebrew/help.rb:73:in `help'
/usr/local/Homebrew/Library/Homebrew/brew.rb:95:in `<main>'

So I went to open a bug report. In the process of creating the bug report, it said I needed to run brew doctor and fix any issues there. So I ran it and got:

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: You have uncommitted modifications to Homebrew
If this is a surprise to you, then you should stash these modifications.
Stashing returns Homebrew to a pristine state but can be undone
should you later need to do so for some reason.
  cd /usr/local/Homebrew/Library && git stash && git clean -d -f

Warning: Homebrew's sbin was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting the PATH for example like so
  echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc

Warning: Broken symlinks were found. Remove them with `brew cleanup`:
  /usr/local/bin/docker
  /usr/local/bin/docker-compose
  /usr/local/bin/docker-credential-osxkeychain
  /usr/local/bin/docker-machine
  /usr/local/bin/hyperkit
  /usr/local/bin/notary
  /usr/local/bin/vpnkit

The last one seemed easy, so I ran brew cleanup, and got this:

Warning: Skipping adwaita-icon-theme: most recent version 3.30.1 not installed
Warning: Skipping ansible: most recent version 2.7.8 not installed
Warning: Skipping autogen: most recent version 5.18.16 not installed
Warning: Skipping awscli: most recent version 1.16.110 not installed
Warning: Skipping bdw-gc: most recent version 8.0.2 not installed
Warning: Skipping cairo: most recent version 1.16.0 not installed
Warning: Skipping dbus: most recent version 1.12.12 not installed
Warning: Skipping gdk-pixbuf: most recent version 2.38.1 not installed
Warning: Skipping glib: most recent version 2.60.0 not installed
Warning: Skipping gnupg: most recent version 2.2.13 not installed
Warning: Skipping gnutls: most recent version 3.6.6 not installed
Warning: Skipping go: most recent version 1.12 not installed
Warning: Skipping gobject-introspection: most recent version 1.58.3 not installed
Warning: Skipping graphite2: most recent version 1.3.13 not installed
Warning: Skipping gst-libav: most recent version 1.14.4 not installed
Warning: Skipping gst-plugins-bad: most recent version 1.14.4 not installed
Warning: Skipping gst-plugins-base: most recent version 1.14.4 not installed
Warning: Skipping gst-plugins-good: most recent version 1.14.4_1 not installed
Warning: Skipping gst-plugins-ugly: most recent version 1.14.4_2 not installed
Warning: Skipping gstreamer: most recent version 1.14.4 not installed
Warning: Skipping gtk+3: most recent version 3.24.5 not installed
Warning: Skipping guile: most recent version 2.2.4_1 not installed
Warning: Skipping harfbuzz: most recent version 2.3.1 not installed
Warning: Skipping icu4c: most recent version 63.1 not installed
Warning: Skipping imagemagick: most recent version 7.0.8-32 not installed
Warning: Skipping jq: most recent version 1.6 not installed
Warning: Skipping libassuan: most recent version 2.5.3 not installed
Warning: Skipping libepoxy: most recent version 1.5.3 not installed
Warning: Skipping libgcrypt: most recent version 1.8.4 not installed
Warning: Skipping libgpg-error: most recent version 1.35 not installed
Warning: Skipping libidn2: most recent version 2.1.1a not installed
Warning: Skipping libosinfo: most recent version 1.3.0 not installed
Warning: Skipping libpng: most recent version 1.6.36 not installed
Warning: Skipping libpsl: most recent version 0.20.2_2 not installed
Warning: Skipping librsvg: most recent version 2.44.13 not installed
Warning: Skipping libsoup: most recent version 2.64.2 not installed
Warning: Skipping libtiff: most recent version 4.0.10_1 not installed
Warning: Skipping libvirt: most recent version 5.0.0 not installed
Warning: Skipping libvirt-glib: most recent version 2.0.0 not installed
Warning: Skipping libxml2: most recent version 2.9.9_2 not installed
Warning: Skipping meson: most recent version 0.49.2 not installed
Warning: Skipping nettle: most recent version 3.4.1 not installed
Warning: Skipping ninja: most recent version 1.9.0 not installed
Warning: Skipping node: most recent version 11.11.0 not installed
Warning: Skipping oniguruma: most recent version 6.9.1 not installed
Warning: Skipping openconnect: most recent version 8.02_1 not installed
Warning: Skipping openshift-cli: most recent version 3.11.0 not installed
Warning: Skipping opus: most recent version 1.3 not installed
Warning: Skipping jeffreywildman/virt-manager/osinfo-db: most recent version 20190120 not installed
Warning: Skipping jeffreywildman/virt-manager/osinfo-db-tools: most recent version 1.3.0 not installed
Warning: Skipping p11-kit: most recent version 0.23.15 not installed
Warning: Skipping packer: most recent version 1.3.5 not installed
Warning: Skipping pango: most recent version 1.42.4_1 not installed
Warning: Skipping pcre: most recent version 8.43 not installed
Warning: Skipping pixman: most recent version 0.38.0 not installed
Warning: Skipping protobuf: most recent version 3.7.0 not installed
Warning: Skipping py2cairo: most recent version 1.18.0 not installed
Warning: Skipping py3cairo: most recent version 1.18.0 not installed
Warning: Skipping pygobject3: most recent version 3.30.4 not installed
Warning: Skipping python: most recent version 3.7.2_2 not installed
Warning: Skipping python@2: most recent version 2.7.16 not installed
Warning: Skipping qemu: most recent version 3.1.0_1 not installed
Warning: Skipping shared-mime-info: most recent version 1.12 not installed
Removing: /Users/wfaulk/Library/Caches/Homebrew/slimerjs--1.0.0.tar.gz... (1.8MB)
Warning: Skipping socat: most recent version 1.7.3.2_3 not installed
Warning: Skipping jeffreywildman/virt-manager/spice-gtk: most recent version 0.36 not installed
Warning: Skipping spice-protocol: most recent version 0.12.15 not installed
Warning: Skipping sqlite: most recent version 3.27.1 not installed
Warning: Skipping stunnel: most recent version 5.50 not installed
Warning: Skipping telnet: most recent version 60 not installed
Warning: Skipping testssl: most recent version 2.9.5-7 not installed
Warning: Skipping usbredir: most recent version 0.8.0 not installed
Warning: Skipping vala: most recent version 0.42.6 not installed
Warning: Skipping jeffreywildman/virt-manager/virt-manager: most recent version 2.1.0 not installed
Warning: Skipping jeffreywildman/virt-manager/virt-viewer: most recent version 7.0_1 not installed
Warning: Skipping vte3: most recent version 0.54.3 not installed
Warning: Skipping w3m: most recent version 0.5.3_6 not installed
Warning: Skipping webp: most recent version 1.0.2 not installed
Warning: Skipping wget: most recent version 1.20.1_4 not installed
Warning: Skipping zsh: most recent version 5.7.1 not installed
Removing: /Users/wfaulk/Library/Caches/Homebrew/Cask/phantomjs--2.1.1.zip... (16.4MB)
Removing: /Users/wfaulk/Library/Logs/Homebrew/cliclick... (64B)
Pruned 7 symbolic links from /usr/local

Then I ran brew doctor again and got this:

/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- active_support/core_ext/object/blank (LoadError)
        from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/local/Homebrew/Library/Homebrew/global.rb:10:in `<top (required)>'
        from /usr/local/Homebrew/Library/Homebrew/brew.rb:21:in `require_relative'
        from /usr/local/Homebrew/Library/Homebrew/brew.rb:21:in `<main>'

Then I ran brew update and got:

/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- tzinfo (LoadError)
        from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.2.1/lib/active_support/values/time_zone.rb:3:in `<top (required)>'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.2.1/lib/active_support/core_ext/time/conversions.rb:4:in `<top (required)>'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.2.1/lib/active_support/core_ext/time/calculations.rb:4:in `<top (required)>'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.2.1/lib/active_support/core_ext/numeric/time.rb:4:in `<top (required)>'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/local/Homebrew/Library/Homebrew/global.rb:11:in `<top (required)>'
        from /usr/local/Homebrew/Library/Homebrew/brew.rb:21:in `require_relative'
        from /usr/local/Homebrew/Library/Homebrew/brew.rb:21:in `<main>'

Same error from brew list, brew help, just plain brew, and even brew lkjdsfg. And now brew doctor gives me the same error, despite being a different error initially.

How can I recover? Other than it being kind of slow, it worked fine before I started all of this.

#2

I found, using git diff, that the “uncommitted modifications to Homebrew” were ruby-related, which I wasn’t expecting, but git stash didn’t work:

...
fatal: git-write-tree: error building trees
Cannot save the current index state

git pull wouldn’t work:

error: Pulling is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.

I was apparently able to resolve this with git reset --mixed:

Unstaged changes after reset:
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.4.0/comparable.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.4.0/enumerable.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.4.0/false_class.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.4.0/fixnum.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.4.0/float.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.4.0/hash.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.4.0/nil_class.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.4.0/regexp.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.4.0/string.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.4.0/string/match.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.4.0/true_class.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.5.0/array.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.5.0/dir.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.5.0/enumerable.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.5.0/hash.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.5.0/integer.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.5.0/kernel.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.5.0/module.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.5.0/string.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.5.0/string/delete_prefix.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.5.0/string/delete_suffix.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.5.0/string/undump.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/2.5.0/struct.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/basic_object.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/std_lib.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/tools.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/tools/alias_method.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/tools/alias_method_chain.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/tools/arguments.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/tools/extreme_object.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/tools/float_integer_conversion.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/tools/io.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/tools/make_block_optional.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/tools/normalize.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/tools/path.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/tools/require_relative_dir.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/tools/std_lib.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/backports-3.12.0/lib/backports/tools/suppress_verbose_warnings.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/mechanize-2.7.6/lib/mechanize/http/content_disposition_parser.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/mechanize-2.7.6/lib/mechanize/version.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/plist-3.5.0/lib/plist.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/plist-3.5.0/lib/plist/generator.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/plist-3.5.0/lib/plist/parser.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/plist-3.5.0/lib/plist/version.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/config/default.yml
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop-rspec.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/align_left_let_brace.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/align_right_let_brace.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/any_instance.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/around_block.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/be.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/be_eql.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/before_after_all.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/capybara/current_path_expectation.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/capybara/feature_methods.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/context_wording.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/cop.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/describe_class.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/describe_method.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/describe_symbol.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/described_class.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/empty_example_group.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/empty_line_after_example_group.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/empty_line_after_final_let.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/empty_line_after_hook.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/empty_line_after_subject.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/example_length.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/example_without_description.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/example_wording.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/expect_actual.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/expect_change.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/expect_in_hook.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/expect_output.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/factory_bot/create_list.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/file_path.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/focus.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/hook_argument.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/hooks_before_examples.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/implicit_expect.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/implicit_subject.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/instance_spy.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/instance_variable.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/invalid_predicate_matcher.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/it_behaves_like.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/iterated_expectation.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/leading_subject.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/let_before_examples.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/let_setup.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/message_chain.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/message_expectation.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/message_spies.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/missing_example_group_argument.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/multiple_describes.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/multiple_expectations.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/multiple_subjects.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/named_subject.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/nested_groups.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/not_to_not.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/overwriting_setup.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/pending.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/predicate_matcher.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/rails/http_status.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/receive_counts.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/receive_never.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/repeated_description.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/repeated_example.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/return_from_stub.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/scattered_let.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/scattered_setup.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/shared_context.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/shared_examples.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/single_argument_message_chain.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/subject_stub.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/unspecified_exception.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/verified_doubles.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/void_expect.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec/yield.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/cop/rspec_cops.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/rspec.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/rspec/align_let_brace.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/rspec/blank_line_separation.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/rspec/concept.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/rspec/config_formatter.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/rspec/description_extractor.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/rspec/example.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/rspec/example_group.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/rspec/final_end_location.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/rspec/hook.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/rspec/inject.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/rspec/language.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/rspec/language/node_pattern.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/rspec/node.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/rspec/top_level_describe.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/rspec/util.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/rspec/version.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-rspec-1.32.0/lib/rubocop/rspec/wording.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/ruby-macho-2.2.0/lib/macho.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/ruby-macho-2.2.0/lib/macho/exceptions.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/ruby-macho-2.2.0/lib/macho/fat_file.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/ruby-macho-2.2.0/lib/macho/headers.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/ruby-macho-2.2.0/lib/macho/load_commands.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/ruby-macho-2.2.0/lib/macho/macho_file.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/ruby-macho-2.2.0/lib/macho/sections.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/ruby-macho-2.2.0/lib/macho/structure.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/ruby-macho-2.2.0/lib/macho/tools.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/ruby-macho-2.2.0/lib/macho/utils.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/ruby-macho-2.2.0/lib/macho/view.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/thread_safe-0.3.6/lib/thread_safe.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/thread_safe-0.3.6/lib/thread_safe/atomic_reference_cache_backend.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/thread_safe-0.3.6/lib/thread_safe/cache.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/thread_safe-0.3.6/lib/thread_safe/mri_cache_backend.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/thread_safe-0.3.6/lib/thread_safe/non_concurrent_cache_backend.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/thread_safe-0.3.6/lib/thread_safe/synchronized_cache_backend.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/thread_safe-0.3.6/lib/thread_safe/synchronized_delegator.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/thread_safe-0.3.6/lib/thread_safe/util.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/thread_safe-0.3.6/lib/thread_safe/version.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/country.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/country_index_definition.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/country_info.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/country_timezone.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/data_source.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/data_timezone.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/data_timezone_info.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/info_timezone.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/linked_timezone.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/linked_timezone_info.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/offset_rationals.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/ruby_core_support.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/ruby_country_info.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/ruby_data_source.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/time_or_datetime.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/timezone.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/timezone_definition.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/timezone_index_definition.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/timezone_info.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/timezone_offset.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/timezone_period.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/timezone_proxy.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/timezone_transition.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/timezone_transition_definition.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/transition_data_timezone_info.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/zoneinfo_country_info.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/zoneinfo_data_source.rb
D       Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/tzinfo-1.2.5/lib/tzinfo/zoneinfo_timezone_info.rb
D       Library/Homebrew/vendor/bundle/ruby/2.4.0
D       Library/Homebrew/vendor/bundle/ruby/2.5.0
D       Library/Homebrew/vendor/bundle/ruby/2.6.0

Then git stash:

Saved working directory and index state WIP on master: 298ed29fb Merge pull request #5875 from Homebrew/dependabot/bundler/Library/Homebrew/activesupport-5.2.2.1

and git clean -d -f (no output) and now brew seems to work again.

(Sean Molenaar) #3

if you want to reset your brew environment and nuke all modifications, brew update-reset is the way to go in the future.

2 Likes
(Joseph Tingsanchali) #4

brew update-reset fixed a similar issue that I was having!

My problem was killing brew upgrade at an inopportune time (i.e. very quickly after initiating brew upgrade) and causing a similar stack trace:

 $ brew upgrade
 /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- backports/2.4.0/string/match (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/Homebrew/Library/Homebrew/extend/string.rb:4:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/Homebrew/Library/Homebrew/global.rb:138:in `<top (required)>'
from /usr/local/Homebrew/Library/Homebrew/brew.rb:21:in `require_relative'
from /usr/local/Homebrew/Library/Homebrew/brew.rb:21:in `<main>'