mongo启动报错Error: uninitialized constant Homebrew::Service::System


字数:181 阅读时长:1分钟 阅读:85

在 Mac M1 系统上安装 MongoDB,启动报错:Error: uninitialized constant Homebrew::Service::System

Brew & MongoDB

问题复现

  1. brew tap mongodb/brew
  2. 使用 brew install mongodb-community (6.0.6) 安装 MongoDB,安装成功
  3. 使用 brew services start mongodb-community 启动 MongoDB,完整报错如下:
1
2
3
4
5
tiven@bogon ~ % brew services stop mongodb-community    
Error: uninitialized constant Homebrew::Service::System
/opt/homebrew/Library/Homebrew/macos_version.rb:150:in `const_missing'
/opt/homebrew/Library/Taps/homebrew/homebrew-services/cmd/services.rb:61:in `services'
/opt/homebrew/Library/Homebrew/brew.rb:94:in `<main>'

解决方案

  1. cd /opt/homebrew/Library/Taps/homebrew
  2. rm -rf ./homebrew-services
  3. brew tap homebrew/services

再次使用 brew services start mongodb-community 启动 MongoDB 就正常了。

1
2
3
4
5
6
# 启动
tiven@bogon homebrew % brew services start mongodb-community
==> Successfully started `mongodb-community` (label: homebrew.mxcl.mongodb-commu

# 停止
tiven@bogon homebrew % brew services stop mongodb-community

欢迎访问:天问博客

本文作者: Tiven
发布时间: 2023-08-05
最后更新: 2023-08-08
本文标题: mongo启动报错Error: uninitialized constant Homebrew::Service::System
本文链接: https://www.tiven.cn/p/ae4f47d7/
版权声明: 本作品采用 CC BY-NC-SA 4.0 许可协议进行许可。转载请注明出处!
欢迎留言,提问 ^_^
个人邮箱: tw.email@qq.com
notification icon
博客有更新,将会发送通知给您!