Rspec : PG::ConnectionBad: PQsocket() 无法获取套接字描述符 [英] Rspec : PG::ConnectionBad: PQsocket() can't get socket descriptor
问题描述
我运行了我的 rspec,但大部分测试都失败了.我对他们有同样的错误,那就是:
I run my rspec and most of the test were failed. I got the same error for them, which is:
Failure/Error: Unable to find matching line from backtrace
ActiveRecord::StatementInvalid:
PG::ConnectionBad: PQsocket() can't get socket descriptor: BEGIN
我发现了一个 问题 与我的问题类似,但还没有答案,我也尝试了这个 link,但这对我没有任何影响.我打开了我的测试控制台并运行了一些最简单的查询并且它起作用了.
I found a question that is similar to my problem, but there is no answer yet and I also tried the solution from this link, but it didn't make any differences for me. I opened my test console and run some simplest queries and it worked.
推荐答案
pg: '0.18.1'
可能存在问题.我尝试恢复到 0.18.0
,我相信问题已经解决了.
There may be a problem with pg: '0.18.1'
. I tried reverting to 0.18.0
, and I believe the problem has gone away.
在本地进行更多测试后,我将在 repo 上打开一个问题.我在 pg 存储库中添加了这个 问题一>.
I'll open up an issue on the repo after testing a bit more locally. I added this issue on the pg repo.
我错了.但实际上有帮助的是安装 spring-commands-rspec gem.我认为它最终为我做的是将它缓存在它可以工作的状态.虽然它也可以很容易地将它缓存在它没有的状态.
I was wrong. What did in fact help though, was installing the spring-commands-rspec gem. I think what it ended up doing for me was caching it in a state where it worked. Although it could also just as easily cache it in a state where it didn't.
这篇关于Rspec : PG::ConnectionBad: PQsocket() 无法获取套接字描述符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!