2016-08-19 38 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... 

我有一個Rails應用程序4使用了binstubs和bin/rspec的偉大工程。是什麼賦予了?

順便說一句,rake spec失敗的方式與數據庫連接錯誤相同。

回答

0

尷尬。我沒有正確設置我的database.yml來繼承*default的設置,所以上面的消息實際上告訴我沒有數據庫在運行。一旦我修好了,binstub再次工作。