标签 brew 下的文章

刚用 AI 写了个处理 YAML 的小工具,因为是 php 写的,直接用了 yaml 扩展。

一运行发现我本地的 php8.3 还没安装 yaml 扩展,虽然可以改成使用第三方包,但觉得还是安装一下试试。

执行 pecl install yaml,提示找不到 libyaml 包。

checking for yaml headers... not found
configure: error: Please install libyaml
ERROR: `/private/tmp/pear/temp/yaml/configure --with-php-config=/opt/homebrew/opt/php/bin/php-config --with-yaml' failed

- 阅读剩余部分 -

闲置了一年多的 mac mini 重新用起来,发现 nginx 挂了。

执行 brew services 报错:

$ brew services
Error: uninitialized constant Homebrew::Service
/opt/homebrew/Library/Homebrew/formula.rb:1267:in `service'
/opt/homebrew/Library/Homebrew/formula.rb:1238:in `plist_name'
/opt/homebrew/Library/Homebrew/formula.rb:1250:in `launchd_service_path'
/opt/homebrew/Library/Taps/homebrew/homebrew-services/lib/service/formula_wrapper.rb:58:in `service_file'
/opt/homebrew/Library/Taps/homebrew/homebrew-services/lib/service/formula_wrapper.rb:92:in `plist?'
/opt/homebrew/Library/Taps/homebrew/homebrew-services/lib/service/formulae.rb:12:in `select'
/opt/homebrew/Library/Taps/homebrew/homebrew-services/lib/service/formulae.rb:12:in `available_services'
/opt/homebrew/Library/Taps/homebrew/homebrew-services/lib/service/formulae.rb:17:in `services_list'
/opt/homebrew/Library/Taps/homebrew/homebrew-services/lib/service/commands/list.rb:13:in `run'
/opt/homebrew/Library/Taps/homebrew/homebrew-services/cmd/services.rb:102:in `services'
/opt/homebrew/Library/Homebrew/brew.rb:97:in `public_send'
/opt/homebrew/Library/Homebrew/brew.rb:97:in `<main>'
If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/homebrew/homebrew-services/issues/new

解决方案

cd /opt/homebrew/Library/Taps/homebrew/
rm -rf homebrew-services/
brew tap homebrew/services

PS: 第三步需要挂代理,否则下载不下来。