如何修复Homebrew“错误:'en_US'无法解析为语言环境”?

时间:2018-09-01 14:53:09

标签: homebrew

每次在Mac上运行brewbrew cask时,都会遇到以下错误:

Error: 'en_US' cannot be parsed to a Locale
Please report this bug:
https://docs.brew.sh/Troubleshooting
/usr/local/Homebrew/Library/Homebrew/locale.rb:15:in `parse'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/dsl.rb:141:in `map'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/dsl.rb:141:in `language_eval'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/dsl.rb:115:in `language'
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/Casks/firefox.rb:125:in `block in load'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask.rb:40:in `instance_eval'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask.rb:40:in `initialize'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:32:in `new'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:32:in `cask'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:76:in `cask'
/usr/local/Homebrew/Library/Homebrew/compat/hbc/cask_loader.rb:15:in `cask'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:122:in `cask'
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/Casks/firefox.rb:1:in `load'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:59:in `instance_eval'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:59:in `load'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:179:in `load'
/usr/local/Homebrew/Library/Homebrew/cleanup.rb:108:in `stale_cask?'
/usr/local/Homebrew/Library/Homebrew/cleanup.rb:53:in `stale?'
/usr/local/Homebrew/Library/Homebrew/cleanup.rb:228:in `block in cleanup_cache'
/usr/local/Homebrew/Library/Homebrew/cleanup.rb:215:in `each'
/usr/local/Homebrew/Library/Homebrew/cleanup.rb:215:in `cleanup_cache'
/usr/local/Homebrew/Library/Homebrew/cleanup.rb:155:in `clean!'
/usr/local/Homebrew/Library/Homebrew/cmd/cleanup.rb:30:in `cleanup'
/usr/local/Homebrew/Library/Homebrew/brew.rb:87:in `<main>'

运行locale后的结果:

LANG="en_US"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"

1 个答案:

答案 0 :(得分:1)

通过此issue,我从更多的研究中学到了,只需执行命令brew update-reset && brew update,就可以通过重置brew解决此问题。