2016-08-19 2 views
2

새로운 Rails 5 앱이 있습니다. 지침에 지정된대로 springspring-commands-rspec 개의 보석을 설치했습니다. 난 rspec 그 자체로 테스트를 잘 실행할 수 있습니다. 내가 bin/rspec binstub 봄을 실행하는 경우,이 얻을 :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가 잘 작동 레일 4 응용 프로그램을 가지고있다. 뭐라 구요?

덧붙여 말하자면, rake spec은 데이터베이스 연결 오류와 동일한 방식으로 실패합니다.

답변

0

당혹 스럽다. 나는 *default에서 설정을 상속 받기 위해 database.yml을 올바르게 설정하지 않았으므로 문자 그대로 위의 메시지는 데이터베이스가 실행되지 않는다고 말했습니다. 일단 그 문제가 해결되면 binstub이 다시 작동합니다.

관련 문제