I am currently running macOS Sierra (latest version) and I have zshell installed. I have tried to follow the steps to install MongoDB Community Edition Manually by using the following commands after downloading the binaries from the MongoDB Download Center.
- tar -zxvf mongodb-osx-ssl-x86_64-3.6.2.tgz
- mkdir -p mongodb
- cp -R -n mongodb-osx-ssl-x86_64-3.6.2/ mongodb
- export PATH=mongodb-install-directory/bin:$PATH
On step 4, my mongodb install directory path is in /Users/(my username)/mongodb. Therefore, I have run the following command:
- export PATH=/Users/(my username)/mongodb/bin:$PATH
From the (my username) directory, I tried to run mongod and got the message zsh: command not found: mongod. However, when I go into /Users/(my username)/mongodb/bin and run ./mongod, everything works except for my data path not being set.
From here, I have tried to set the db path by running the following command:
- ./mongod --dbpath /Users/(my username)/mongodb/data/db
Then I ran ./mongod and the data path was not found. What am I doing wrong? I even tried to install MongoDB Community Edition with Homebrew and the same errors popped up.
I am not sure if this would make a difference, but I have installed vagrant in the past and I was able to use MongoDB.