After installing mongdb on my macbook-pro, it tells me:
If this is your first install, automatically load on login with:
cp /usr/local/Cellar/mongodb/1.6.3-x86_64/org.mongodb.mongod.plist ~/Library/LaunchAgents launchctl load -w ~/Library/LaunchAgents/org.mongodb.mongod.plist
If this is an upgrade and you already have the org.mongodb.mongod.plist loaded:
launchctl unload -w ~/Library/LaunchAgents/org.mongodb.mongod.plist cp /usr/local/Cellar/mongodb/1.6.3-x86_64/org.mongodb.mongod.plist ~/Library/LaunchAgents launchctl load -w ~/Library/LaunchAgents/org.mongodb.mongod.plist
Or start it manually:
mongod run --config /usr/local/Cellar/mongodb/1.6.3-x86_64/mongod.conf
But after I copy org.mongodb.mongod.plist
to ~/Library/LaunchAgents
, it tells me:
launchctl load -w ~/Library/LaunchAgents/org.mongodb.mongod.plist
launchctl: Couldn't stat("/Users/why/Library/LaunchAgents/org.mongodb.mongod.plist"):
Not a directory
And also I can not cd "~/Library/LaunchAgents"
, but I can ls
the directory!
~/Library/LaunchAgents
is a strange directory on mac.
Did you make sure that you created the
~/Library/LaunchAgents
directory first? You may have just ended up copying/usr/local/Cellar/mongodb/1.6.3-x86_64/org.mongodb.mongod.plist
to a file called~/Library/LaunchAgents
Try
ls -la ~/Library/LaunchAgents
and see what the output is. It should look like:If instead you see:
Then you copied the MongoDB plist to a file called
LaunchAgents
. Here's how to remedy that: