Reputation: 7324
Using Mac OSX 10.10.4 on 13' Macbook Air
Typed in 'brew update' like the Mongo docs said and it updated Then typed 'brew install mongodb' and it took ages to say
Error: Permission denied - (mongod.conf, /usr/local/etc/mongod.conf)
This is what the console said leading up to that point, in case this helps:
Joshuas-Air:~ Josh$ brew install mongodb
==> Downloading https://homebrew.bintray.com/bottles/mongodb-3.0.4.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring mongodb-3.0.4.yosemite.bottle.tar.gz
Error: Permission denied - /usr/local/etc/mongod.conf
Warning: Bottle installation failed: building from source.
==> Installing mongodb dependency: scons
==> Downloading https://homebrew.bintray.com/bottles/scons-2.3.5.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring scons-2.3.5.yosemite.bottle.tar.gz
🍺 /usr/local/Cellar/scons/2.3.5: 208 files, 2.4M
==> Downloading https://fastdl.mongodb.org/src/mongodb-src-r3.0.4.tar.gz
######################################################################## 100.0%
==> Cloning https://github.com/mongodb/mongo-tools.git
Updating /Library/Caches/Homebrew/mongodb--github.com-mongodb-mongo-tools--git
==> Checking out tag r3.0.4
==> ./build.sh
==> /usr/local/opt/scons/bin/scons install --prefix=/usr/local/Cellar/mongodb/3.0.4 -j4 --osx-version-min=10.10 --cc=/usr/bin/clang --cxx=/usr/bin/clang++ --use-new-tools
Error: Permission denied - (mongod.conf, /usr/local/etc/mongod.conf)
Joshuas-Air:~ Josh$
Any help at all would be appreciated.
Upvotes: 3
Views: 6118
Reputation: 279
I had mostly the same error. I could not solve the problem by chown'ing the /usr/local directories as the prompts suggest possibly due to my upgrade to High Sierra. I was able to succeed installing mongodb by reinstalling homebrew using the following command:
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
This allowed my subsequent brew install mongodb
to work.
Upvotes: 3
Reputation: 111
I had the same problem, changing the directory permissions didn't work for me so eventually I've found this solution:
.tgz
).~/Downloads
folder or wherever you saved the file.tar xvf filename.tgz
.bin
directory.sudo bash
(become root) command.cp * /usr/local/bin
./data/db
directories (optional, this is the default location MongoDB uses).exit
to exit root user.which mongo
should now respond with /usr/local/bin
and you are all set to go.Upvotes: 2
Reputation: 9808
My guess is that the permissions on the folder /usr/local/ are not set 755 or 777. You can change the permissions or simply try to run the command as root:
sudo brew install mongodb
Upvotes: 0