0
rails console
で既存のmLabデータベースに接続しようとしています。毎回のIクエリ(例えばGameScore.all.count
、User.all.count
は)、私は、次のエラーメッセージが返されています:Mongo :: Error :: NoServerAvailable in Rails 5のアプリケーション開発環境
Mongo::Error::NoServerAvailable: No server is available matching preference: #<Mongo::ServerSelector::Primary:0x70240308536180 tag_sets=[] max_staleness=nil> using server_selection_timeout=30 and local_threshold=0.015 from /Users/-/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/mongo-2.4.1/lib/mongo/server_selector/selectable.rb:115:in `select_server'
は、ここに私のmongoid.yml
ファイルがセットアップされている方法は次のとおりです。
development:
clients:
default:
uri: 'mongodb://username:[email protected]:port/db_name'
options:
consistency: :strong
max_retries: 30
retry_interval: 1
timeout: 15
は、任意のヘルプをお願い申し上げます。本当に今この問題で困った。
解決済み。 Rails 4.2.7とmongoid 4に劣化しなければならなかった。魅力的に働いた。 – fish