
Bobs-MacBook-Pro-2:~ bobhannan$ brew services start mongodb
Error: Unknown command: services
Bobs-MacBook-Pro-2:~ bobhannan$ brew services list
Error: Unknown command: services
使用服務而不是服務也有問題。
答案1
沒有名為 的指令brew services
。
這些存在:
brew install
brew uninstall
brew search
brew list
brew update
brew upgrade
brew pin/unpin
brew doctor
brew install -vd
brew --env | config
brew create URL --no-fetch
brew edit
您可以使用以下方式安裝它:
curl -o /usr/local/bin/brew-services.rb https://gist.githubusercontent.com/lwe/766293/raw/75a7907004bbff0eb3b072d1d951be2cfe7e5020/brew-services.rb
chmod +x /usr/local/bin/brew-services.rb
brew services help
答案2
首先,透過點擊 homebrew/boneyard (一次)來安裝brew服務:
brew tap homebrew/boneyard
注意:設定launchctl自動啟動mongo
$ launchctl 載入 ~/Library/LaunchAgents/homebrew.mxcl.mongo.plist $ launchctl 卸載 ~/Library/LaunchAgents/homebrew.mxcl.mongo.plist
來源 :http://robots.thoughtbot.com/starting-and-stopping-background-services-with-homebrew