Addressable::URI::InvalidURIError: Cannot have a path with two leading slashes without an authority set: '//'

Addressable::URI::InvalidURIError: Cannot have a path with two leading slashes without an authority set: '//'

我们的测试套件在本地通过。但是在 Circle CI 中,对于我们使用水豚编写的所有集成测试,我们都会收到如下所示的错误,Rspec。

Failures:

  1) the inspection access When inspector has no access removes inspection from table
     Failure/Error: visit '/'

     Addressable::URI::InvalidURIError:
       Cannot have a path with two leading slashes without an authority set: '//'
     # /home/ubuntu/.bundle_end_to_end/ruby/2.3.0/gems/addressable-2.5.2/lib/addressable/uri.rb:2429:in `validate'
     # /home/ubuntu/.bundle_end_to_end/ruby/2.3.0/gems/addressable-2.5.2/lib/addressable/uri.rb:1538:in `path='
     # /home/ubuntu/.bundle_end_to_end/ruby/2.3.0/gems/capybara-2.15.2/lib/capybara/session.rb:265:in `visit'
     # /home/ubuntu/.bundle_end_to_end/ruby/2.3.0/gems/capybara-2.15.2/lib/capybara/dsl.rb:50:in `block (2 levels) in <module:DSL>'
     # ./spec/support/sessions_management.rb:3:in `sign_in'
     # ./spec/support/sessions_management.rb:19:in `sign_in_as'
     # ./spec/inspection_access_spec.rb:11:in `block (3 levels) in <top (required)>'

  2) the inspection access When inspector has access adds the inspection to the table
     Failure/Error: visit '/'

     Addressable::URI::InvalidURIError:
       Cannot have a path with two leading slashes without an authority set: '//'

Rails 4.2.8 和 Ruby 2.3.3。知道我们应该在哪里查看吗?

您已将 Capybara.app_host 设置为尾随“/”(例如 Capybara.app_host = "http://www.example.com/" )。这导致 Capybara 2.15.2 在访问“/”时出现问题。如果可能,请删除尾随的“/”(例如 Capybara.app_host =http://www.example.com` ),或者回滚到 Capybara 2.15.1 直到 2.15.3 发布。