buo / homebrew-cask-upgrade

A command line tool for upgrading every outdated app installed by Homebrew Cask
MIT License
2.44k stars 90 forks source link

brew cu : "Error: private method `load' called for Hbc:Module" and exits 1 after `brew update` #105

Closed sebma closed 6 years ago

sebma commented 6 years ago

Hi,

After a brew upate called by brew cu, I get this :

==> Finding outdated apps
Error: private method `load' called for Hbc:Module
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:45:in `rescue in load_cask'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:42:in `load_cask'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:14:in `block in installed_apps'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:11:in `map'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:11:in `installed_apps'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu.rb:66:in `find_outdated_apps'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu.rb:24:in `process'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/cmd/brew-cu.rb:34:in `<top (required)>'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Homebrew/Library/Homebrew/utils.rb:18:in `require?'
/usr/local/Homebrew/Library/Homebrew/brew.rb:93:in `<main>'
$ echo $?
1
$ brew --version
Homebrew 1.7.1-20-ga1f0ff4
Homebrew/homebrew-core (git revision 837545; last commit 2018-07-25)
$ brew cask --version
Homebrew-Cask 1.7.1-20-ga1f0ff4
Homebrew/homebrew-cask (git revision 43373; last commit 2018-07-25)

I thought issue #102 was related but the brew cask outdated command proposed there is broken on my system because of java7 so I cannot go further on this track.

Then I tried the following commands below but it did not solve the pb. :

$ brew untap buo/cask-upgrade
Untapping buo/cask-upgrade...
Untapped 2 commands (78 files, 78KB).
$ brew cu
Error: Unknown command: cu
$ brew tap buo/cask-upgrade
==> Tapping buo/cask-upgrade
Cloning into '/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade'...
remote: Counting objects: 21, done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 21 (delta 0), reused 12 (delta 0), pack-reused 0
Unpacking objects: 100% (21/21), done.
Tapped 2 commands (57 files, 49KB).
$ brew cu
==> Options
Include auto-update (-a): false
Include latest (-f): false
==> Updating Homebrew
Already up-to-date.
==> Finding outdated apps
Error: private method `load' called for Hbc:Module
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:45:in `rescue in load_cask'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:42:in `load_cask'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:14:in `block in installed_apps'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:11:in `map'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:11:in `installed_apps'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu.rb:66:in `find_outdated_apps'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu.rb:24:in `process'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/cmd/brew-cu.rb:34:in `<top (required)>'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Homebrew/Library/Homebrew/utils.rb:18:in `require?'
/usr/local/Homebrew/Library/Homebrew/brew.rb:93:in `<main>'
$ echo $?
1
ondrejfuhrer commented 6 years ago

Hey @sebma , please run brew cask outdated to figure out, which casks are not maintained any more and remove them. After that it should work.

ondrejfuhrer commented 6 years ago

Also you can take a look into this issue where this was as well discussed: https://github.com/buo/homebrew-cask-upgrade/issues/100

sebma commented 6 years ago

@ondrejfuhrer

$ brew cask outdated
Error: undefined method `undent' for #<String:0x000000010425a058>
Follow the instructions here:
  https://github.com/Homebrew/homebrew-cask#reporting-bugs
/usr/local/Caskroom/java7/.metadata/1.7.0_80/20170503124403.890/Casks/java7.rb:72:in `block in load'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask.rb:36:in `instance_eval'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask.rb:36:in `initialize'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:31:in `new'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:31:in `cask'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:67:in `cask'
/usr/local/Homebrew/Library/Homebrew/compat/hbc/cask_loader.rb:15:in `cask'
/usr/local/Caskroom/java7/.metadata/1.7.0_80/20170503124403.890/Casks/java7.rb:1:in `load'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:57:in `instance_eval'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:57:in `load'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/caskroom.rb:34:in `block in casks'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/caskroom.rb:28:in `map'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/caskroom.rb:28:in `casks'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/outdated.rb:13:in `block in run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/abstract_command.rb:47:in `casks'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/outdated.rb:13:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/abstract_command.rb:33:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:93:in `run_command'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:159:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:124:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:7:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:87:in `<main>'
ondrejfuhrer commented 6 years ago

@sebma As suggested in all the related issues, remove the cask. In your case java7

rm -rf /usr/local/Caskroom/java7
sebma commented 6 years ago

@ondrejfuhrer Both brew cask outdated and brew cu work now, thanks !

yurikoles commented 6 years ago

Upstream issue: https://github.com/Homebrew/homebrew-cask/issues/49716