I installed MongoDB via Homebrew (following http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/) but it's not working.
Typing mongod
at shell prompt gives me:
-bash: mongod: command not found
Not sure if I need to add something for Homebrew to my PATH env var?
I can see Mongo is installed under /usr/local/Cellar/mongodb
– but am assuming I don't need to add everything I install via homebrew to the path? Also, assuming I can run mongod from any directory or am I actually meant to be in install directory?
When I run brew doctor
I get:
Warning: You have unlinked kegs in your Cellar
Followed by a list of 3 items which includes MongoDB – but I'm not sure how I'm meant to link them?
Works perfectly
brew update
brew tap mongodb/brew
brew install [email protected]
For latest version, check https://docs.mongodb.com/manual/release-notes/
You're getting this error because your 'brew' install failed to create the correct symlinks in /usr/local/bin. As a result, the shell can't find the mongo executables in your $PATH. You can fix this using the following steps:
Check the permissions on /usr/local/bin and make sure that you own that directory and have write permissions on it
$ ls -ld /usr/local/bin
Once you've fixed that, run 'brew link' to fix the symlinks
$ brew link mongodb
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With