目录

 

1.Homebrew命令报错

2.问题分析

3.解决方法


1.Homebrew命令报错

安装 nasm的时候突然报错了,报错信息如下

Traceback (most recent call last):

11: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `<main>'

10: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `require_relative'

9: from /usr/local/Homebrew/Library/Homebrew/global.rb:37:in `<top (required)>'

8: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'

7: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'

6: from /usr/local/Homebrew/Library/Homebrew/os.rb:3:in `<top (required)>'

5: from /usr/local/Homebrew/Library/Homebrew/os.rb:21:in `<module:OS>'

4: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:58:in `prerelease?'

3: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:24:in `version'

2: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:24:in `new'

1: from /usr/local/Homebrew/Library/Homebrew/os/mac/version.rb:26:in `initialize'

/usr/local/Homebrew/Library/Homebrew/version.rb:368:in `initialize': Version value must be a string; got a NilClass () (TypeError)

所有的命令,好像都失效了

2.问题分析

造成这个 Homebrew 失效的原因可能是 Mac 在升级成 Big Sur 系统后(我的是 macOS Big Sui Version 11.4),旧版本的 Homebrew 不适配了

3.解决方法

网上查了下最新版的 Homebrew 已经解决了这个错误,所以 Homebrew 更新到最新的版本就可以了

更新指令

brew update-reset
brew update-reset

Homebrew更新完成之后,我们再再执行 brew -v 看看

完美执行了,说明现在Homebrew是正常的了,可以正常使用了

 

🌹欢迎大家留言交流,批评指正,互相学习😁,提升自我🌹

 

 

 

GitHub 加速计划 / br / brew
19
0
下载
🍺 The missing package manager for macOS (or Linux)
最近提交(Master分支:3 个月前 )
2432d018 build(deps-dev): bump rubocop from 1.69.2 to 1.70.0 in /Library/Homebrew 2 天前
ffc661b1 Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gems.yml) workflow. 2 天前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐