1. 问题背景
在本地 mac 上使用命令
brew install hugo
安装 hugo 命令,报错 Error: hugo: no bottle available!
Warning: You are using macOS 12.
We do not provide support for this pre-release version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this
pre-release version.
Error: hugo: no bottle available!
You can try to install from source with:
brew install --build-from-source hugo
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other
official channels.
2. 解决思路
- 起初以为是 macos 12 与 hugo 不适配,google 了一下并没有发现类似问题,排除。
- 怀疑是 brew 换源导致,
brew config查看配置
HOMEBREW_VERSION: 3.6.17-31-g077e9dc
ORIGIN: https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
HEAD: 077e9dccaf92d36db7e58a179ac7cfa017f18b10
Last commit: 73 minutes ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: a7787dca7148f19b0ef36f3f6f5f28c21dc88199
Core tap last commit: 1 year, 7 months ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.8 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.8_1/bin/ruby
CPU: octa-core 64-bit haswell
Clang: 12.0.0 build 1200
Git: 2.24.3 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.79.1 => /usr/bin/curl
macOS: 12.4-x86_64
CLT: 12.0.0.32.29
Xcode: 12.0.1
是使用的清华源,加上我本地挂了 vpn,合理怀疑是这个原因,便更改本地 proxy
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
重新安装,下载过程中报错
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
################ 22.7%curl: (92) HTTP/2 stream 1 was not closed cleanly before end of the underlying stream
Error: hugo: Failed to download resource "hugo"
Download failed: https://ghcr.io/v2/homebrew/core/hugo/blobs/sha256:32ad322954e9c2962849495c88c88e461d21a0a7d3bfa3aa4892ee34f569bf81
随重启 zsh
source ~/.zshrc
再次安装,成功~