よくあるエラー
Mongoid/Moped 認証エラー: エラー13で失敗しました
次のエラーが発生した場合:
Moped::Errors::OperationFailure: The operation: #<Moped::Protocol::Command @length=83 @request_id=5 @response_to=0 @op_code=2004 @flags=[] @full_collection_name="mongose_development.$cmd" @skip=0 @limit=-1 @selector={:getlasterror=>1, :w=>1} @fields=nil> failed with error 13: "not authorized for insert on mongose_development.people" See https://github.com/mongodb/mongo/blob/master/docs/errors.md for details about this error. from /.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/bundler/gems/moped-10abbf3eac37/lib/moped/operation/read.rb:50:in `block in execute' from /.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/bundler/gems/moped-10abbf3eac37/lib/moped/node.rb:594:in `[]' from /.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/bundler/gems/moped-10abbf3eac37/lib/moped/node.rb:594:in `block (2 levels) in flush' from /.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/bundler/gems/moped-10abbf3eac37/lib/moped/node.rb:593:in `map' from /.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/bundler/gems/moped-10abbf3eac37/lib/moped/node.rb:593:in `block in flush' from /.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/bundler/gems/moped-10abbf3eac37/lib/moped/node.rb:617:in `block in logging' from /.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in `block in instrument' from /.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0/lib/active_support/notifications/instrumenter.rb:20:in `instrumen
このエラーは、Mongoid で使用されなくなった Ruby ドライバーである Moped が原因です。 Mongoid 5 + にアップグレードすると、この問題が修正されます。
この問題の詳細については、こちらをご覧ください: MONGOID-4067 。