치과 의사가 서버에 연결할 수 없습니다. 여기에 내가지고있어 오류입니다 : 나는에 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를 통해 전송되는 이유에 대한 아이디어는 크게 감사하겠습니다.
관련성이있는 경우 명령 줄에서 phantomjs를 사용하여'http : //127.0.0.1 : 3000 /'을 연결할 수 있습니다. – equivalentideas