自酿: cask 'java'定义无效

标签 homebrew homebrew-cask

最近更新 cask 时,我开始出现以下错误:

Error: Cask 'java' definition is invalid: Token '{:v1=>"java"}' in header line does not match the file name.

我使用的是MacOS 10.14.4,并且我的 Homebrew 版本:
→ brew --version
Homebrew 2.1.2
Homebrew/homebrew-core (git revision 6811d1; last commit 2019-05-11)
Homebrew/homebrew-cask (git revision ba4e3; last commit 2019-05-11)

这是brew cask upgrade --verbose --debug的输出:
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> Updated Formulae
angular-cli          atlassian-cli        libpqxx              terraforming
app-engine-python    elasticsearch        osm2pgrouting
asciidoctorj         jenkins-lts          postgresql

==> Casks with `auto_updates` or `version :latest` will not be upgraded
==> Upgrading 1 outdated package:
Error: Cask 'java' definition is invalid: Token '{:v1=>"java"}' in header line does not match the file name.
/usr/local/Homebrew/Library/Homebrew/cask/cask_loader.rb:73:in `cask'
/usr/local/Caskroom/java/.metadata/1.8.0_51-b16/20150725210402.758/Casks/java.rb:1:in `load'
/usr/local/Homebrew/Library/Homebrew/cask/cask_loader.rb:62:in `instance_eval'
/usr/local/Homebrew/Library/Homebrew/cask/cask_loader.rb:62:in `load'
/usr/local/Homebrew/Library/Homebrew/cask/cask_loader.rb:178:in `load'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/upgrade.rb:39:in `block in run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/upgrade.rb:37:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/upgrade.rb:37:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/abstract_command.rb:36:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:92:in `run_command'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:158:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:123:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:9:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:102:in `<main>'
Error: Kernel.exit
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:162:in `exit'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:162:in `rescue in run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:146:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:123:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:9:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:102:in `<main>'

brew tap的输出:
beeftornado/rmtree
heroku/brew
homebrew/cask
homebrew/core
homebrew/services

如果有帮助,这是brew doctor的输出:
→ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
  /Users/myUser/anaconda3/bin/icu-config
  /Users/myUser/anaconda3/bin/krb5-config
  /Users/myUser/anaconda3/bin/freetype-config
  /Users/myUser/anaconda3/bin/xslt-config
  /Users/myUser/anaconda3/bin/libpng16-config
  /Users/myUser/anaconda3/bin/python3.6m-config
  /Users/myUser/anaconda3/bin/libpng-config
  /Users/myUser/anaconda3/bin/xml2-config
  /Users/myUser/anaconda3/bin/python3-config
  /Users/myUser/anaconda3/bin/curl-config
  /Users/myUser/anaconda3/bin/ncursesw6-config
  /Users/myUser/anaconda3/bin/pcre-config
  /Users/myUser/anaconda3/bin/python3.6-config
  /Applications/Postgres.app/Contents/Versions/9.4/bin/gdal-config

Warning: Some installed formulae are not readable:
  dotwrp: Unsupported special dependency :fortran
(base)

我已经搜索过,但似乎找不到解决此问题的方法。
有什么建议么?

最佳答案

通过执行以下操作解决:

  • 编辑了Java容器:
  • vim /usr/local/Caskroom/java/.metadata/1.8.0_51-b16/20150725210402.758/Casks/java.rb
    
  • 更改了第一行:
  • cask :v1 => 'java' do

    cask 'java' do
  • 删除了 cask 末端的undent注释,这给我带来了问题。
  • brew cask uninstall java

  • 问题解决了💥

    关于自酿: cask 'java'定义无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56092643/

    相关文章:

    linux - 错误: command '/usr/bin/gcc-4.8' failed with exit status 1 when installing spiff with linuxbrew

    python - pip 错误 : Bad interpreter when trying to run 'pip install ...' on OS X

    homebrew - 更改 homebrew-cask 安装目录

    java - 如何使用 java -version 命令查看 brew 安装的 java?

    homebrew - 在 .zshrc 中设置 ZSH_DISABLE_COMPFIX=true 不起作用

    perl - Mac M1 Homebrew Perl Carton Net::SSLeay 正在以不安全的方式加载 libcrypto

    python - 如何在 macos Catalina 中将 python homebrew 版本设置为默认版本

    macos - brew cask 更新或卸载错误 : definition is invalid: invalid 'depends_on macos' value: ":lion"

    homebrew - 安装 Homebrew 后 zsh compinit : insecure directories error message on Mac,

    macos - 错误:桶/桶已移动。点击自酿/ cask 代替