Mongo::Error::NoServerAvailable: No primary server is available in cluster
Verify you are able to connect to the nodes using the MongoDB shell (
mongo
binary). Most likely you do not have connectivity.Set log level to debug (https://docs.mongodb.com/mongoid/master/tutorials/mongoid-configuration/#logging) which will tell you what the driver is doing as it is attempting to connect to the deployment.