'Can't run Homebrew: Cask 'x48' definition is invalid

Running any brew command gives me

Error: Cask 'x48' definition is invalid: invalid depends_on key: ':x11'

Because of this I can't even run brew doctor to get information on how to address the error.

How do I proceed? What do I need to do to get past this error and get Homebrew working again?



Solution 1:[1]

Still had that issue, so tried to deleted this file:

rm -rf "$(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-cask/Casks/x48.rb

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 AnK