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

Error: undefined method `path' for Hbc::Caskroom:Module #97

Closed electriquo closed 6 years ago

electriquo commented 6 years ago

i am running brew cu -y -a daily. since today, i got the following error

$ brew cu -y -a
Error: undefined method `path' for Hbc::Caskroom:Module
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:1:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/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)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/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)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/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:101:in `<main>'

clearly it has something to do with this commit.

when i revert the commit, everything works as expected. any idea?

SkyRaker commented 6 years ago

I met the same issue TAT.

TomorrowWu commented 6 years ago

I met the same thing

randpop commented 6 years ago

Same here...

ondrejfuhrer commented 6 years ago

Hey @y0y0z , try running brew update before, seems like you have old version of brew running with the new version of brew-cask-upgrade

zym013579 commented 6 years ago

@ondrejfuhrer In my opinion, seems like he have old version of brew-cask-upgrade running with the new version of brew

ghost commented 6 years ago

I have the same

ghost commented 6 years ago

me too

alioguz commented 6 years ago

Try running cd "$(brew --repo)" && git fetch && git reset --hard origin/master && brew update

ondrejfuhrer commented 6 years ago

@zym013579 Nope, since the Hbc::Caskroom.path is the new way of getting the caskroom path 🙂

@alioguz Was just writing the same thing 👍

SkyRaker commented 6 years ago

@alioguz Cooooool!

zym013579 commented 6 years ago

@ondrejfuhrer got it, thanks

randpop commented 6 years ago

I did run brew update before, but no luck with that. @alioguz: that did the trick! 👍

GentleHoneyLover commented 6 years ago

Had the same problem. Solution by @alioguz fixed it (thanks!)

buo commented 6 years ago

I fixed this issue in the commit 36b26b3f2a2c6fe295b6a507d1d73ab28bc7f6ad by trying to call both Hbc.caskroom and Hbc::Caskroom.path. Thanks!