2017-01-18 9 views
1

私は現在、mongolabに既存のリモートDBを持つ新しいRails 5アプリを設定しています。私はmongoidを使用しています。ここで私はconfig/mongoid.yml下セットアップdevelopmentをしました方法は次のとおりです。Rails 5アプリでリモートmLab開発用DBにアクセスするにはどうすればいいですか?

database: <insert_database_name> 
hosts: 
- <db_number>.mlab.com 

options: 
user: <db_user_username> 
password: <db_user_password> 

私もdevelopment内部uri文字列が、運と上記のparamsを交換してみました。私はrails consoleを使ってリモートdbにアクセスしたいと思っています。私は何が欠けていますか?

答えて

0

解決済み。 Railsのインストールを4.2.7およびmongoid 4.に劣化させなければならなかった。魅力的に働いた。

0

私はデータベースの設定に使用するのと同じ構文を使用し、それはまだ私のレール5とmongoid 5で動作します。それが助けて欲しい!

database: manga_app 
    hosts: 
    - ds151108.mlab.com:51108 
    options: 

    # The name of the user for authentication. 
    user: 'xxx' (xxx is the username you set for database not the name you use to sign in) 

    # The password of the user for authentication. 
    password: 'yyy' (yyy is the password you set for the database not the password you use to sign in) 
関連する問題