ruby - Mongoid; ERROR Mongo::Error::OperationFailure: not authorized for query -
i creating application using ruby/grape , mongoid. when try create or find document in collection using mongoid, example admin.create
following error:
error mongo::error::operationfailure: not authorized query on databse.collection
i can log in mongo console , create/find documents fine credentials use in mongoid.yml.
mongoid.yml:
production: clients: default: database: my_db hosts: - myhost:port username: db_user password: my_password
you're format off. try this
production: clients: default: database: my_db hosts: - myhost:port options: user: db_user password: my_password
notice options
section , username
user
Comments
Post a Comment