Capybara + Selenium Capybara + Selenium selenium selenium

Capybara + Selenium


I just faced te same problem, but found a solution.

If you try to open your browser with "http://127.0.0.1:3000" in development mode, instead of "http://localhost:3000", you should face the same problem.

In my case the problem was caused, because in my View file I used "request.domain" that returns nil if request is given in IP-like format, i.e. "http://127.0.0.1:50752".

Therefore, if somewhere in your view of helper methods you have something like this

link_to "Click me", :host => subdomain + "." + request.domain + request.port_string

you can change it to using helper method, like that:

link_to "Click me", :host => with_host(subdomain)

And helper like following:

  def with_host(subdomain)    if request.domain.present?      subdomain + "." + request.domain + request.port_string    end  end

That's the easiest solution that worked for me. Perhaps, you have something similar.