brew services start mongodb-community@4.0 失败 - 未初始化的常量
brew services start mongodb-community@4.0 fails - uninitialized constant
我已按照 MongoDB docs 上的说明使用自制程序在 Mac 上安装 MongoDB:
brew tap mongodb/brew
brew install mongodb-community@4.0
然后我可以 运行 它在前台使用:
mongod --config /usr/local/etc/mongod.conf
但是,当尝试使用以下方式将其作为服务启动时:
brew services start mongodb-community@4.0
我收到这个错误:
Error: mongodb-community: uninitialized constant #<Class:0x00007ff189061008>::Gem
当 运行ning brew doctor
:
时我也遇到这个错误
Warning: Some installed formulae are not readable:
mongodb-community: uninitialized constant #<Class:0x00007ffd903152a0>::Gem
为什么会这样?我该如何解决?
谢谢!
我知道这不是正确答案,因为我们正在谈论使用以下方式注册服务:
brew services start mongodb-community
但我已经解决了服务注册问题:
sudo cp /usr/local/Cellar/mongodb-community/4.0.9/homebrew.mxcl.mongodb-community.plist /Library/LaunchAgents/
launchctl load -w /Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist
launchctl start mongodb-community
这是 mongodb-community 公式的错误。 An issue has been filed with the maintainers, a solution found, and a pull request with the fix 已打开。
在此期间,您可以自行修复错误。公式中的 This line 抛出异常:
Gem::Version.new(v['version'])
因为Gemclass还没有导入。添加导入:
require 'rubygems'
问题解决。您可以在本地执行此操作,方法是在您的计算机上查找和编辑公式。它可能在这个文件中:
/usr/local/Homebrew/Library/Taps/mongodb/homebrew-brew/Formula/mongodb-community.rb
更新: 一位社区贡献者已在上游修复了此问题。如果您仍然遇到此问题,您可能需要 运行 brew update
我已按照 MongoDB docs 上的说明使用自制程序在 Mac 上安装 MongoDB:
brew tap mongodb/brew
brew install mongodb-community@4.0
然后我可以 运行 它在前台使用:
mongod --config /usr/local/etc/mongod.conf
但是,当尝试使用以下方式将其作为服务启动时:
brew services start mongodb-community@4.0
我收到这个错误:
Error: mongodb-community: uninitialized constant #<Class:0x00007ff189061008>::Gem
当 运行ning brew doctor
:
Warning: Some installed formulae are not readable:
mongodb-community: uninitialized constant #<Class:0x00007ffd903152a0>::Gem
为什么会这样?我该如何解决?
谢谢!
我知道这不是正确答案,因为我们正在谈论使用以下方式注册服务:
brew services start mongodb-community
但我已经解决了服务注册问题:
sudo cp /usr/local/Cellar/mongodb-community/4.0.9/homebrew.mxcl.mongodb-community.plist /Library/LaunchAgents/
launchctl load -w /Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist
launchctl start mongodb-community
这是 mongodb-community 公式的错误。 An issue has been filed with the maintainers, a solution found, and a pull request with the fix 已打开。
在此期间,您可以自行修复错误。公式中的 This line 抛出异常:
Gem::Version.new(v['version'])
因为Gemclass还没有导入。添加导入:
require 'rubygems'
问题解决。您可以在本地执行此操作,方法是在您的计算机上查找和编辑公式。它可能在这个文件中:
/usr/local/Homebrew/Library/Taps/mongodb/homebrew-brew/Formula/mongodb-community.rb
更新: 一位社区贡献者已在上游修复了此问题。如果您仍然遇到此问题,您可能需要 运行 brew update