报错信息
brew install gitlab-runner
报错如下所示 :
flamingyouth@FelixMacBook-Pro-2 docker % brew install gitlab-runner
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-cask, skipping update!
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-core, skipping update!
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-services, skipping update!
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/gitlab-runner-14.4.0.arm64_monterey.bottle.tar.gz
curl: (22) The requested URL returned error: 404
Warning: Bottle missing, falling back to the default domain...
==> Downloading https://ghcr.io/v2/homebrew/core/gitlab-runner/manifests/14.4.0
Already downloaded: /Users/flamingyouth/Library/Caches/Homebrew/downloads/404c14fc75eb6b25854e33c8afc3ecdacaa32903f02df1fea2313dcbe8a30a5e--gitlab-runner-14.4.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/gitlab-runner/blobs/sha256:ff7fcb67c66534a36b32d043c573005421ebc26fe87fe09937cdc9164708b900
Already downloaded: /Users/flamingyouth/Library/Caches/Homebrew/downloads/56146b1be1fc80e48cc3fbc7f5fd2c65884f06f03c87ef511827a9d11215809e--gitlab-runner--14.4.0.arm64_monterey.bottle.tar.gz
fatal: not in a git directory
Error: Command failed with exit 128: git
解决办法
brew -v 查看会有两个提示,提示用户设置 homebrew-cask
和 homebrew-core
的文件路径为设置为safe.directory, 即使用如下命名:
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask
flamingyouth@FelixMacBook-Pro-2 docker % git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask
flamingyouth@FelixMacBook-Pro-2 docker % brew -v
Homebrew 3.5.2
Homebrew/homebrew-core (git revision 9cc3d4b202f; last commit 2021-11-24)
Homebrew/homebrew-cask (git revision f422fb2cee; last commit 2021-11-24)
之后再执行 brew install gitlab-runner
即可,操作如下
flamingyouth@FelixMacBook-Pro-2 docker % brew install gitlab-runner
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-services, skipping update!
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/gitlab-runner-14.4.0.arm64_monterey.bottle.tar.gz
curl: (22) The requested URL returned error: 404
Warning: Bottle missing, falling back to the default domain...
==> Downloading https://ghcr.io/v2/homebrew/core/gitlab-runner/manifests/14.4.0
Already downloaded: /Users/flamingyouth/Library/Caches/Homebrew/downloads/404c14fc75eb6b25854e33c8afc3ecdacaa32903f02df1fea2313dcbe8a30a5e--gitlab-runner-14.4.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/gitlab-runner/blobs/sha256:ff7fcb67c66534a36b32d043c573005421ebc26fe87fe09937cdc9164708b900
Already downloaded: /Users/flamingyouth/Library/Caches/Homebrew/downloads/56146b1be1fc80e48cc3fbc7f5fd2c65884f06f03c87ef511827a9d11215809e--gitlab-runner--14.4.0.arm64_monterey.bottle.tar.gz
==> Pouring gitlab-runner--14.4.0.arm64_monterey.bottle.tar.gz
==> Caveats
To restart gitlab-runner after an upgrade:
brew services restart gitlab-runner
Or, if you don't want/need a background service you can just run:
/opt/homebrew/opt/gitlab-runner/bin/gitlab-runner run --syslog
==> Summary
? /opt/homebrew/Cellar/gitlab-runner/14.4.0: 9 files, 59MB
==> `brew cleanup` has not been run in the last 30 days, running now...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /Users/flamingyouth/Library/Caches/Homebrew/telnet--63... (53.5KB)
Removing: /Users/flamingyouth/Library/Caches/Homebrew/telnet_bottle_manifest--63... (6.3KB)
Removing: /Users/flamingyouth/Library/Logs/Homebrew/telnet... (64B)
评论区