Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

brew services start [email protected] Error: Unknown command: services

I am trying to run MongoDB by running brew services start [email protected] but I am getting the error that you see below:

jaimes-mbp:SMR jaimemontoya$ brew services start [email protected]
==> Tapping homebrew/services
Cloning into '/usr/local/Library/Taps/homebrew/homebrew-services'...
remote: Enumerating objects: 27, done.
remote: Counting objects: 100% (27/27), done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 27 (delta 0), reused 16 (delta 0), pack-reused 0
Unpacking objects: 100% (27/27), done.
Checking connectivity... done.
Tapped 0 formulae (63 files, 276K)
Error: Unknown command: services
jaimes-mbp:SMR jaimemontoya$ 

Isn't brew the command, and services only a parameter? I am not understanding why the error says that services is an unknown command. Thank you.

UPDATE 1: I see two warnings when I try to run brew install [email protected] again. Maybe that has something to do with the problem?:

jaimes-mbp:SMR jaimemontoya$ brew install [email protected]
Warning: mongodb/brew/mongodb-community-4.2.3 already installed
Warning: You are using OS X 10.15.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.

UPDATE 2: When I use mongo, it is doing something:

jaimes-mbp:SMR jaimemontoya$ mongo
MongoDB shell version v4.2.3
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
2020-03-13T06:41:22.073-0600 E  QUERY    [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:341:17
@(connect):2:6
2020-03-13T06:41:22.076-0600 F  -        [main] exception: connect failed
2020-03-13T06:41:22.076-0600 E  -        [main] exiting with code 1
jaimes-mbp:SMR jaimemontoya$  

Maybe I do not need to use brew services start [email protected]? I thought it was necessary to run MongoDB Community Edition.

UPDATE 3: I run ps aux | grep -v grep | grep mongod and it returns nothing. I am trying to verify that MongoDB is running, so I am searching for mongod in my running processes but it returns nothing, meaning that MongoDB is not running I guess.

UPDATE 4: See what happens when I run brew doctor --verbose:

Warning: You are using OS X 10.15.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.

Warning: Your Homebrew is outdated.
You haven't updated for at least 24 hours. This is a long time in brewland!
To update Homebrew, run `brew update`.

Warning: The /usr/local directory is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. Some versions of the
"InstantOn" component of Airfoil are known to do this.

You should probably change the ownership and permissions of /usr/local back to your user account. sudo chown -R $(whoami):admin /usr/local

When I run sudo chown -R $(whoami):admin /usr/local, I get this:

jaimes-mbp:SMR jaimemontoya$ sudo chown -R $(whoami):admin /usr/local
Password:
chown: /usr/local: Operation not permitted
jaimes-mbp:SMR jaimemontoya$ 

brew update is not working:

jaimes-mbp:SMR jaimemontoya$ brew update
Error: The /usr/local directory is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. Some versions of the
"InstantOn" component of Airfoil are known to do this.

You should probably change the ownership and permissions of /usr/local
back to your user account.
  sudo chown -R $(whoami):admin /usr/local
jaimes-mbp:SMR jaimemontoya$ 
like image 331
Jaime Montoya Avatar asked Oct 16 '22 05:10

Jaime Montoya


1 Answers

Seems like you are facing issue with brew.

Run brew doctor --verbose to check if the brew is working fine.

And then brew update to update the brew version.

After this run, brew services list to display all the services in the brew.

If you see [email protected] there in the list, then run brew services start [email protected]

It should work.

like image 172
Vijay Rajpurohit Avatar answered Oct 21 '22 06:10

Vijay Rajpurohit