Poltergeistがサーバーに接続できません。ここで私が取得していますエラーです:私はphantomjsのデバッグ出力を持っているパスヘルパーを使用しているときにCapybara Poltergeistがhttpsを強制的に使用する
Failure/Error: visit root_path
Capybara::Poltergeist::StatusFailError:
Request to 'http://127.0.0.1:58638/' failed to reach server, check DNS and/or server status
は、ここで私に関連する行のようになります。このビットは、手掛かりNetwork - Resource request error: QNetworkReply::NetworkError(ConnectionRefusedError) ("Connection refused") URL: "https://127.0.0.1/"
のように思えた
2016-12-14T14:24:47 [DEBUG] WebpageCallbacks - getJsConfirmCallback
{"command_id":"5eab3091-26bd-47b7-b779-95ec9523fb5b","response":true}
{"id":"1069af41-1b7c-4f5b-a9c7-258185aa8c73","name":"visit","args":["http://127.0.0.1:58638/"]}
2016-12-14T14:24:47 [DEBUG] WebPage - updateLoadingProgress: 10
2016-12-14T14:24:48 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(ConnectionRefusedError) ("Connection refused") URL: "https://127.0.0.1/"
2016-12-14T14:24:48 [DEBUG] WebPage - updateLoadingProgress: 100
2016-12-14T14:24:48 [DEBUG] WebPage - setupFrame ""
2016-12-14T14:24:48 [DEBUG] WebPage - setupFrame ""
2016-12-14T14:24:48 [DEBUG] WebPage - evaluateJavaScript "(function() { return (function() {\n return typeof __poltergeist;\n })(); })()"
2016-12-14T14:24:48 [DEBUG] WebPage - evaluateJavaScript result QVariant(QString, "undefined")
{"command_id":"1069af41-1b7c-4f5b-a9c7-258185aa8c73","error":{"name":"Poltergeist.StatusFailError","args":["http://127.0.0.1:58638/",null]}}
{"id":"cbe42cdc-58db-49c5-a230-4a1f4634d830","name":"reset","args":[]}
それはsslエラーである可能性があるので、私はphantomjsオプション--ignore-ssl-errors=true
を追加しましたが、それは応答に何の違いもありません。
私はcapybara-webkit
に切り替えて、一部の人が推薦しているように、より多くの情報を提供するかどうかを確認しました。私は、特定非HTTPS URLがカピバラに訪問した場合、それが動作することを実現トーマス・ウォルポール@の助けを借りて
"Visit(http://127.0.0.1:64341/)" started page load
Started request to "http://127.0.0.1:64341/"
Finished "Visit(http://127.0.0.1:64341/)" with response "Success()"
Started request to "https://127.0.0.1/"
Received 301 from "http://127.0.0.1:64341/"
Received 0 from "https://127.0.0.1/"
Page finished with false
Load finished
Page load from command finished
Wrote response false "{"class":"InvalidResponseError","message":"Unable to load URL: http://127.0.0.1:64341/ because of error loading https://127.0.0.1/: Unknown error"}"
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.
:私は非常に類似したエラーを取得します。たとえば、visit "http://localhost:3000"
です。 visit root_url
を使用しますが、visit root_path
を使用すると、上記のhttpsとエラーが表示されます。
config.force_ssl
は該当しません。 config/environments/test.rb
にconfig.force_ssl = false
を設定し、テストのコンテキストでApplication.config
を確認するためにも使用しました。
パスヘルパーがhttps経由で送信されている理由についてのご意見をいただければ幸いです。
関連性のある場合は、コマンドラインでphantomjを使って 'http://127.0.0.1:3000 /'に接続することができます。 – equivalentideas