brew install hugo问题解决

Golang写的Hugo看起来非常棒。

直接报错了:

Traceback (most recent call last):
11: from /usr/local/Homebrew/Library/Homebrew/brew.rb:31:in <main>' 10: from /usr/local/Homebrew/Library/Homebrew/brew.rb:31:inrequire_relative’
9: from /usr/local/Homebrew/Library/Homebrew/global.rb:80:in <top (required)>' 8: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:inrequire’
7: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require' 6: from /usr/local/Homebrew/Library/Homebrew/os.rb:7:in
5: from /usr/local/Homebrew/Library/Homebrew/os.rb:43:in <module:OS>' 4: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:60:inprerelease?’
3: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:28:in version' 2: from /usr/local/Homebrew/Library/Homebrew/os/mac/version.rb:33:infrom_symbol’
1: from /usr/local/Homebrew/Library/Homebrew/os/mac/version.rb:33:in fetch' /usr/local/Homebrew/Library/Homebrew/os/mac/version.rb:33:inblock in from_symbol’: unknown or unsupported macOS version: :dunno (MacOSVersionError)
Error: ‘git’ must be installed and in your PATH!
Traceback (most recent call last):
11: from /usr/local/Homebrew/Library/Homebrew/brew.rb:31:in <main>' 10: from /usr/local/Homebrew/Library/Homebrew/brew.rb:31:inrequire_relative’
9: from /usr/local/Homebrew/Library/Homebrew/global.rb:80:in <top (required)>' 8: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:inrequire’
7: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require' 6: from /usr/local/Homebrew/Library/Homebrew/os.rb:7:in
5: from /usr/local/Homebrew/Library/Homebrew/os.rb:43:in <module:OS>' 4: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:60:inprerelease?’
3: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:28:in version' 2: from /usr/local/Homebrew/Library/Homebrew/os/mac/version.rb:33:infrom_symbol’
1: from /usr/local/Homebrew/Library/Homebrew/os/mac/version.rb:33:in fetch' /usr/local/Homebrew/Library/Homebrew/os/mac/version.rb:33:inblock in from_symbol’: unknown or unsupported macOS version: :dunno (MacOSVersionError)

把xcode删除后,造成了一些的坑。错误提示如下:

Error: 'git' must be installed and in your PATH!

解决思路:

先运行一下Git命令:

LideMacBook-Pro ~ % git
xcrun: error: active developer path (“/Applications/Xcode.app/Contents/Developer”) does not exist
Use sudo xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools, or use xcode-select --install to install the standalone command line developer tools.
See man xcode-select for more details.

尝试使用:

xcode-select --install

安装后,依然报错:

xcode-select: error: command line tools are already installed, use “Software Update” to install updates

自动安装的不行,尝试去苹果官网下载command工具箱重装,地址:

https://developer.apple.com/download/all/?q=command

重装后,问题解决。

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注