|
本帖最后由 gnn 于 2024-8-17 00:35 编辑
问题:
运行brew services list 报错,报错如下:
- Error: uninitialized constant Homebrew::Service
- /usr/local/Homebrew/Library/Homebrew/formula.rb:1267:in `service'
- /usr/local/Homebrew/Library/Homebrew/formula.rb:1238:in `plist_name'
- /usr/local/Homebrew/Library/Homebrew/formula.rb:1250:in `launchd_service_path'
- /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/lib/service/formula_wrapper.rb:58:in `service_file'
- /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/lib/service/formula_wrapper.rb:92:in `plist?'
- /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/lib/service/formulae.rb:14:in `block in available_services'
- /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/lib/service/formulae.rb:14:in `select'
- /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/lib/service/formulae.rb:14:in `available_services'
- /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/lib/service/formulae.rb:25:in `services_list'
- /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/lib/service/commands/list.rb:13:in `run'
- /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/cmd/services.rb:129:in `services'
- /usr/local/Homebrew/Library/Homebrew/brew.rb:98:in `public_send'
- /usr/local/Homebrew/Library/Homebrew/brew.rb:98: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
复制代码
解决方案:
删除以安装的homebrew/services
升级homebrew
具体步骤:
1)找到本机的homebrew/services 安装目录
- /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services
复制代码
2)删除 homebrew-services
- rm -rf /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services
复制代码
3)用brew tap命令升级 homebrew-services
- brew tap homebrew/services
复制代码 升级成功
- noway@Mac-mini homebrew % brew tap homebrew/services
- ==> Tapping homebrew/services
- Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services'...
- remote: Enumerating objects: 3088, done.
- remote: Counting objects: 100% (550/550), done.
- remote: Compressing objects: 100% (210/210), done.
- remote: Total 3088 (delta 356), reused 462 (delta 335), pack-reused 2538 (from 1)
- Receiving objects: 100% (3088/3088), 868.18 KiB | 310.00 KiB/s, done.
- Resolving deltas: 100% (1497/1497), done.
- Tapped 1 command (48 files, 1MB).
复制代码 验证brew services命令
- noway@Mac-mini homebrew % brew services list
- Name Status User File
- emacs none
- postgresql@14 started noway ~/Library/LaunchAgents/homebrew.mxcl.postgresql@14.plist
- unbound none
复制代码
|
|