Rails Mongoid fails to authenticate - failed with error 13: “not authorized for query on my_db.my_collection”
问题 This issue was said to be resolved the latest version of Moped but still happens to me. I have a rails 4.2 app with Mongoid, created a user for a MongoDB DB with readWrite and dbOwner roles, and set auth=true in the mong.conf file. I can perform any actions on the DB with that user credentials using the Mongo shell or a simple Java application using their Mongo driver. However, when trying to authenticate with Mongoid I always get this error: failed with error 13: "not authorized for query on