homebrew-cask-upgrade: Error: undefined method `caskroom' for Hbc:Module

$ brew cu
Error: undefined method `caskroom' for Hbc:Module
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:1:in `<top (required)>'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3_2/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3_2/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu.rb:6:in `<top (required)>'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3_2/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3_2/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/cmd/brew-cu.rb:32:in `<top (required)>'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3_2/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3_2/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:105:in `<main>'

$ brew --version
Homebrew 1.6.7-56-g9ebcef7
Homebrew/homebrew-core (git revision 512758; last commit 2018-06-09)

$ brew cask --version
Homebrew-Cask 1.6.7-56-g9ebcef7
Homebrew/homebrew-cask (git revision c97f0; last commit 2018-06-09)

$ brew irb
=> Interactive Homebrew Shell
Example commands available with: brew irb --examples
irb(main):001:0> Hbc.methods.grep /cask/
=> []

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 14
  • Comments: 29 (6 by maintainers)

Commits related to this issue

Most upvoted comments

@goodwillcoding You are correct. Many thanks. Let me write down the way I rephrase it.

go to /usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb and change the first line CASKROOM= Hbc.Caskroom to CASKROOM=Hbc::Caskroom.path

That’s it.

A quick git-bisect start 9ebcef78 61bcec42 in /usr/local/Homebrew shows this is the breaking commit.

Hey @reitermarkus

I can of course speak only for myself and I am aware that this option is out there. If I put aside much nicer “UI”, the main differences for me are:

  1. Easier usage - I don’t have to run more commands to know what I’m going to update and the updating itself (I run only brew cu instead of brew cask outdated and brew cask upgrade)

  2. Better handling of auto-update casks. I.e. this morning: After funning brew cu -ac screencapture at wed jun 13 09 35 50 cest 2018

After running brew cask outdated screencapture at wed jun 13 09 39 25 cest 2018

After running brew cask outdated --greedy screencapture at wed jun 13 09 37 54 cest 2018

So in this case I either update only plex-media-player or all “latest” and auto-update apps. That does not happen in brew cu

Those are the biggest advantages for me right now.

@reitermarkus Well, in this case (google-chrome) it is useful. Of course, you will get the same version just by running it and leave the updating to the app. But the cask also have the version written inside, so you end up with inconsistency between the installed version detected by brew and the actual installed version. But of course, that it super minor thing since the end is the same - you have up-to-date software which should be the goal.

Regarding the first one @jenhsun already touched the surface. Of course I don’t have to run outdated before, but I want to know, what I’m going to update before I start to do it. Why? For example I always quit the application before I update in order to have the update smoother.

What brew cu brings here very nicely is the overview, what are the outdated casks and then you just confirm or not confirm, that you want to update. And you don’t have to run other command to do so.

I hope that clarifies my point of view here 🙂

Thanks for telling me what I should want.

I meant no offence, and apologise if I did offend.

That assumes that I actually have automatic updating enables within the applications. For most apps, this can be disabled and I consequently do that.

Fair. I hadn’t considered that.

I’ve never encountered any problematic downgrades, though I see the theoretical possibility.

I can guarantee downgrades have happened, but it’s unlikely they have been problematic.

I said it is an additional check.

So did I. The point is I’m asking you to not trust those at all from a security standpoint. It’s not their goal.

I can at least be sure that I get the same download as the person who updated the cask

And Travis CI. But that is fine; that’s exactly what they’re for, integrity checks.

I’m not saying that my strategy is a perfect model, but given the various constraints it’s the best I can achieve and working quite well for me.

Thumbs up to that. Again, I had no intention to belittle your method.

@reitermarkus My reasoning is similar to what @ondrejfuhrer described: I basically want to include apps that have auto_updates true in the upgrade. There are two main reasons for that (see also #53):

  1. Upgrading as much as possible in one go, without having to open the apps
  2. Having additional authenticity checks using checksums from a third-party source

As far as I can see, I could kind of get that using brew cask upgrade --greedy, but that’ll always include version :latest apps. These don’t really fit nicely into the concept described above, but they’re a reality and re-downloading them all the time is not an efficient solution.

Since #53, brew cu allows to include apps with auto_updates true while excluding those with version :latest, which is not ideal, but viable. I don’t think this is possible with brew cask upgrade.

then you just confirm or not confirm

That part at least will never be possible. Homebrew is non-interactive by design. However we would definitely accept a PR which provides a nicer overview.