2
我有一個新的Rails 5應用程序。我按照他們的指示安裝了spring
和spring-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
失敗的方式與數據庫連接錯誤相同。