“Rake spec”在大多数测试中失败,但“rails s”在Diaspora源上工作正常

我有克隆的Diaspora来源,我有一个工作的本地吊舱似乎顺利运行。 但是当我运行$ rake spec一些初始测试通过,然后所有这些都开始失败。 此外,我发现有趣的是,每次运行rake spec时它们都会在不同的点上失败。

他们都失败了,错误:

 An error occurred in an after hook ActiveRecord::StatementInvalid: PG::ConnectionBad: PQsocket() can't get socket descriptor: ROLLBACK occurred at /home/darshan/.rvm/gems/ruby-2.0.0-p353@diaspora/gems/activerecord-3.2.16/lib/active_record/connection_adapters/postgresql_adapter.rb:650:in `async_exec' 

Postgres的日志说:

 could not receive data from client: Connection reset by peer unexpected EOF on client connection 

我遇到了同样的问题,发现通过使用本地unix套接字文件,而不是通过localhost访问Postgres服务器,问题似乎已经消失。

要实现此目的,请从database.yml文件中删除host: localhost ,然后重新运行rake spec 。 这默认返回本地套接字文件(通常是/ tmp或/ var / run / postgres中的.s.PGSQL.5432,具体取决于您的平台。)

我遇到了同样的问题 。 我尝试恢复到0.18.0而不是0.18.1 ,这似乎解决了我。

转到postgres.conf并将ssl = true更改为ssl = false

我在这里找到了解决这个问题的方法,它对我有用。

Interesting Posts