关于 ruby?? on rails:Capybara-Webkit “无法加载 URL”

Capybara-Webkit "Unable to load URL"

我已经为这个问题苦苦挣扎了几天,无法弄清楚是什么导致了这个问题。测试套件在 TravisCI 上运行良好,并且在我重新启动计算机时在本地运行。不过,在本地做某事后,我不断收到相同的错误消息:

1
Unable to load URL: http://localhost.dev:3001/en/users/sign_in because of error loading http://localhost.dev:3001/en/users/sign_in: Unknown error (Capybara::Webkit::InvalidResponseError)

这是完整的 webkit 调试跟踪:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Using the default profile...
..........Finished"EnableLogging" with response"Success()"
Wrote response true""
Received"Visit"
Started"Visit"
Load started
"Visit" started page load
Started request to"http://localhost.dev:3001/en/users/sign_in"
Finished"Visit" with response"Success()"
Received 0 from"http://localhost.dev:3001/en/users/sign_in"
Page finished with false
Load finished
Page load from command finished
Wrote response false"{"class":"InvalidResponseError","message":"Unable to load URL: http://localhost.dev:3001/en/users/sign_in because of error loading http://localhost.dev:3001/en/users/sign_in: Unknown error"}"
F-Received"Reset"
Started"Reset"
undefined|0|SECURITY_ERR: DOM Exception 18: An attempt was made to break through the security policy of the user agent.
Finished"Reset" with response"Success()"
Wrote response true""
Received"FindXpath"
Started"FindXpath"
Finished"FindXpath" with response"Success()"
Wrote response true""
..........F--------

(::) failed steps (::)

Unable to load URL: http://localhost.dev:3001/en/users/sign_in because of error loading http://localhost.dev:3001/en/users/sign_in: Unknown error (Capybara::Webkit::InvalidResponseError)

这出现在我尝试 visit 路径的应用程序中的任何位置。据我了解,"未知错误"来自 qt,而不是 capybara-webkit,但我不太确定谁最好问。我将 DNSmasq 用于子域,我们有多种语言,因此 localhost:3000 被重定向到 www.localhost.dev:3000/en。

事物的当前版本:

  • 水豚 2.4.1
  • 水豚-webkit 1.1.0
  • Cucumber 1.3.14
  • Cucumber rails 1.4.0
  • 第 0.7.1 页
  • rails 4.0.0
  • ruby 2.1.2
  • dnsmasq 2.71
  • PostgreSQL 9.3.5
  • qt 4.8.6 OSX - 小牛队 10.9.4

编辑 1:也发布在 capybara-webkit 存储库上:https://github.com/thoughtbot/capybara-webkit/issues/667

编辑 2:这里是测试日志文件:https://gist.github.com/GolfyMcG/060053eba51a9ba69722


正如我在相关的 Github 问题中发布的那样,我在这里找到了解决方案:

https://apple.stackexchange.com/questions/26616/dns-not-resolving-on-mac-os

与 Capybara-webkit 无关,与我如何让我的 ElasticSearch 实例在测试中旋转有关。