[英]Capybara-webkit raises Capybara::Driver::Webkit::WebkitInvalidResponseError
I got following message from webkit driver in my rspec: 我在我的rspec中收到了webkit驱动程序的以下消息:
Capybara::Driver::Webkit::WebkitInvalidResponseError:
Unable to load URL: http://127.0.0.1:44923/posts
Few days ago it worked. 几天前它起作用了。 The problem is with save_page
method. 问题在于save_page
方法。 What could be wrong? 可能有什么不对?
I've had similar error messages when my page was raising an error. 当我的页面出现错误时,我收到了类似的错误消息。 You should check manually that this is not the case by starting a server in testing mode ( rails s -e test
) and accessing the page yourself. 您应该通过在测试模式下启动服务器( rails s -e test
)并自己访问该页面来手动检查是不是这种情况。
Check if you don't have any other error in your application that could prevent Capybara from loading the page. 检查您的应用程序中是否有任何其他错误可能会阻止Capybara加载页面。 Last time I got it, I realized that there was a 500 error page and that was why Capybara raised Capybara::Driver::Webkit::WebkitInvalidResponseError. 上次我得到它,我意识到有一个500错误页面,这就是为什么Capybara提出Capybara :: Driver :: Webkit :: WebkitInvalidResponseError。
Try removing gem thin
from your bundle completely. 尝试从包中完全删除gem thin
。
Even if it is in :development
or :production
group only! 即使它只在:development
或:production
组!
In your test.rb
: 在你的test.rb
:
set config.action_dispatch.show_exceptions = true
设置config.action_dispatch.show_exceptions = true
and you will see the exception that caused the WebkitInvalidResponseError
并且您将看到导致WebkitInvalidResponseError
的异常
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.