homebrew-cask: brew cask install returns "Error: MethodDeprecatedError"

General troubleshooting steps

Description of issue

After the fix from #44694 I am now seeing a different error when running brew cask install <caskname> - Error: MethodDeprecatedError.

I ran the following commands:

$ export HOMEBREW_DEVELOPER=1
$ brew update
Updated Homebrew from b067700f to 254ce8bb.
No changes to formulae.

Output of your command with --verbose --debug

$ brew cask install node --debug --verbose
Error: MethodDeprecatedError

Output of brew cask doctor

$ brew cask doctor
Error: MethodDeprecatedError

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 19 (5 by maintainers)

Most upvoted comments

  1. It only happened with brew cask commands.
  2. brew tap had the usual caskroom/cask and homebrew/core BUT it also had the phinze/cask

That’s when I realized that even though Homebrew itself was up-to-date that the setup must have been very old on that El Capitan machine. I ran this command and suddenly everything worked again.

Thank you for helping me on the right track! 😗 I hope it helps the others as well.

AHA! @arakashic and @drjsanger’s advice worked. I had:

export HOMEBREW_CASK_OPTS="--appdir=/Applications --caskroom=/opt/homebrew-cask/Caskroom"

…in my .bashrc. Changed that to:

export HOMEBREW_CASK_OPTS="--appdir=/Applications"

$ unset HOMEBREW_CASK_OPTS

$ source .bashrc

$ echo $HOMEBREW_CASK_OPTS
--appdir=/Applications

$ brew update
Updated 1 tap (homebrew/core).
==> Updated Formulae
asciidoctor               hfstospell                hopenpgp-tools            just                      scala

$ brew --version
Homebrew 1.5.11
Homebrew/homebrew-core (git revision d1e8c7; last commit 2018-03-20)

$ brew cask info google-chrome
google-chrome: 65.0.3325.162
https://www.google.com/chrome/
Not installed
From: https://github.com/caskroom/homebrew-cask/blob/master/Casks/google-chrome.rb
==> Name
Google Chrome
==> Artifacts
Google Chrome.app (App)

I noticed that I had this problem because I was setting HOMEBREW_CASK_OPTS=--caskroom=/opt/homebrew-cask/Caskroom. After removing it, brew cask works fine.