我收到以下錯誤,當我嘗試連接到遠程數據庫MongoID InvalidMechanism mongodb_cr
"mongodb_cr" is invalid, please use mongodb_cr, mongodb_x509, gssapi or plain.
我可以沒有問題從我的終端或任何其他應用程序(如robomongo)連接尤斯相同的憑據和身份驗證機制
有什麼疑惑我是"mongodb_cr" is invalid
請用mongodb_cr
這是我的mongoid.yml文件的內容
development:
clients:
default:
database: urijijami
hosts:
- <%= ENV['MONGO_HOST'] || 'localhost' %>
options:
user: <%= ENV['MONGO_USER'] %>
password: <%= ENV['MONGO_PASS'] %>
# Change the default authentication mechanism. Valid options are: :scram,
# :mongodb_cr, :mongodb_x509, and :plain. Note that all authentication
# mechanisms require username and password, with the exception of :mongodb_x509.
# Default on mongoDB 3.0 is :scram, default on 2.4 and 2.6 is :plain.
auth_mech: mongodb_cr
# Configure Mongoid specific options. (optional)
options:
raise_not_found_error: false