2016-08-19 6 views
2

私は新しいRails 5アプリケーションを持っています。私はspringspring-commands-rspecの宝石を指示通りにインストールしました。私はrspecを単独で実行することができ、テストは正常に動作します。私は春のbinstub bin/rspecを実行する場合しかし、私はこれを取得:春rspecがデータベースに接続できません

Running via Spring preloader in process 227 
/usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `initialize': could not connect to server: No such file or directory (PG::ConnectionBad) 
    Is the server running locally and accepting 
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? 
    from /usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `new' 
    from /usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `connect' 
    from /usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:217:in `initialize' 
    from /usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `new' 
    from /usr/local/bundle/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection' 
    etc... 

私はbinstubsを使用し、bin/rspecは素晴らしい作品Railsの4アプリを持っています。何がありますか?

なお、rake specは、同じデータベース接続エラーで同じ方法で失敗します。

答えて

0

困った。私は*defaultから設定を継承するためにdatabase.ymlを正しく設定していないので、上記のメッセージは文字通りデータベースが実行されていないことを伝えていました。私はそれを固定したら、ビンスタブは再び働いた。

関連する問題