87
47

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

homebrewのcaskコマンドはオプションになりました。

Posted at

homebrewでGUIをもつアプリをインストールしたい時はcaskを使いますよね。
mac入れ替えで初期セットアップ中に下記のようなエラーに遭遇しました。

hori$ brew cask install google-cloud-sdk
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
libvdpau                                                           xcb-util-cursor
==> Updated Formulae
Updated 107 formulae.
==> Updated Casks
Updated 319 casks.
==> Deleted Casks
gfortran                                                           openxcom

Error: Calling brew cask install is disabled! Use brew install [--cask] instead.

解決策

brew cask install ~ ではなく brew install --cask ~ を使えばOKでした。

hori$ brew install --cask google-cloud-sdk
==> Caveats
google-cloud-sdk is installed at /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk. Add your profile:

  for bash users
    source "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc"
    source "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc"

  for zsh users
    source "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc"
    source "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc"

  for fish users
    source "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.fish.inc"

==> Downloading https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz
######################################################################## 100.0%
Warning: No checksum defined for cask 'google-cloud-sdk', skipping verification.
==> Installing Cask google-cloud-sdk
Beginning update. This process may take several minutes.

補足

Error: Calling brew cask install is disabled! Use brew install [--cask] instead.

よく読めば書いてありましたね。
brew cask install は無効になったよ! --cask を使ってね!

こちらのissueを参考にしました。
https://github.com/ansible-collections/community.general/issues/1524
(ansibleのissueですが・・・^^;)

brew cask コマンドは2.6から非推奨になり、2.7から無効化されたようです。
2.8からはエラーメッセージも表示されなくなるそうです。
https://github.com/Homebrew/brew/pull/9247
ここで対応されてました。

私の環境はちょうど2.7でした。

hori$ brew --version
Homebrew 2.7.0
Homebrew/homebrew-core (git revision fd7c4; last commit 2020-12-24)
Homebrew/homebrew-cask (git revision 2fd68; last commit 2020-12-24)
87
47
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
87
47

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?