Moped::Errors::ConnectionFailure Could not connect to any secondary or primary nodes for replica set
I was able to get it working by removing the mongod.lock
file and restarting mongodb service
sudo rm /var/lib/mongodb/mongod.lock
sudo service mongodb start