Я пытаюсь подключиться к mongodb, размещенному на MLab, но аутентификация не удалась.
При запуске приложения rails выдается ошибка:
Moped::Errors::AuthenticationFailure: The operation: #<Moped::Protocol::Commands::Authenticate
@length=168
@request_id=3
@response_to=0
@op_code=2004
@flags=[]
@full_collection_name="heroku_vjmpxxzn.$cmd"
@skip=0
@limit=-1
@selector={:authenticate=>1, :user=>"heroku_vjmpxxzn", :nonce=>"9a254f9ab71432e4", :key=>"79a149a6651d6e8234e6d45718eff7f0"}
@fields=nil>
failed with error 18: "auth failed"
Я уже пробовалобновить версию mongoid, но если я сделаю это, мне нужно будет обновить множество других драгоценных камней, и это займет много времени.
Это мой mongoid.yml
производственный конфиг.
production:
sessions:
default:
database: <database>
username: <user>
password: <pass>
hosts:
- ds333748-a0.mlab.com:33748
- ds333748-a1.mlab.com:33748
options:
consistency: :strong
skip_version_check: true
safe: true
Я использую:
- ruby 2.3.8
- рельсы 3.2.22.5
- mongoid 3.1.0
Gemfile
source 'https://rubygems.org'
ruby "2.3.8"
gem 'rails', '3.2.22.5'
gem 'rest-client'
gem 'bundler', '1.15.2'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
# Gems used only for assets and not required
# in production environments by default.
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem "cpf_cnpj"
gem "savon"
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'uglifier', '>= 1.0.3'
gem 'adminlte2-rails'
gem 'jquery-rails'
gem 'will_paginate_mongoid'
gem "mongo_session_store-rails3"
gem 'geocoder', '1.3.3'
gem 'test-unit'
gem 'nokogiri'
gem 'sprockets', '~> 2'
gem "httparty", '0.13.3'
gem 'mongoid-geospatial'
gem 'credit_card_validations'
gem "chartkick"
gem "time_difference"
gem 'newrelic_rpm'
gem 'dropzonejs-rails'
gem 'mongoid_auto_increment', :git => 'git://github.com/teriyakisan/mongoid_auto_increment.git'
gem 'parse-ruby-client', git: 'https://github.com/adelevie/parse-ruby-client.git', ref: '98596a04dfc30295c1d078c58c31b4cea299e8ca'
gem 'websocket-rails', github: 'moaa/websocket-rails', branch: 'threadsocket-rails'
gem 'websocket-rails-js', github: 'websocket-rails/websocket-rails-js', branch: 'sub_protocols'
gem 'faye-websocket', '0.10.0'
gem 'momentjs-rails'
gem "pagarme"
gem "mongoid", ">= 3.1.0"
gem "paperclip", ' 3.1.1'
gem "mongoid-paperclip", :require => "mongoid_paperclip"
gem 'aws-sdk', '< 3.0'
gem "google-api-client"
gem "cucumber-rails", ">= 1.3.0", :group => :test, :require => false
gem 'apipie-rails'
gem "devise", ">= 2.2.3"
gem "quiet_assets", ">= 1.0.1", :group => :development
gem "figaro", ">= 0.5.3"
gem "better_errors", ">= 0.6.0", :group => :development
gem "binding_of_caller", ">= 0.6.9", :group => :development
gem 'client_side_validations'
gem 'fcm'
gem 'redis'
gem 'rack-cors'
gem 'certified'
group :production do
gem 'thin'
end