Mongo: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145
I assume that you followed the steps, outlined here.
Most probably you have a problem with mongo lock (or at least I had it once while installing on ubuntu). I solved it with the following commands:
sudo rm /var/lib/mongodb/mongod.locksudo service mongodb restart
P.S. I by myself recently experienced this problem when I was updating my amazon ec2
instance. I have not properly shut down mongo before doing this and this resulted in a problem with mongo lock.