I recently installed mongodb-2.6.0 with Homebrew.
After successfully installed, I tried to connect using the mongo command. I am receiving the following errors
I encountered the exact same issue and here is a clear step by step process to avoid this error.
Step 1 - Installation ( Don't follow this step if you have already installed MongoDB ):
brew update
brew install mongodb
Step 2 - Run Mongo Daemon:
mkdir -p /data/db
sudo mongod
Step 3 - Run Mongo Shell Interface:
mongo
In this sequence, I was able to run the mongo command without any error. I have also detailed the error trace and its solution on this blog.