while trying this mongo command in ubuntu I am getting this error.
ritzysystem@ritzysystem-Satellite-L55-A:~$ mongo
MongoDB shell version: 2.6.1
Just some thoughts on my case.
If you have changed the dbPath and logPath dirs to your custom values (say /data/mongodb/data, /data/mongodb/log), you must chown them to mongodb user, otherwise, the non-existent /data/db/ dir will be used.
sudo chown -R mongodb:mongodb /data/mongodb/
sudo service mongod restart