Search code examples
ruby-on-railsubuntu-servercapybara-webkit

Error using capybara-webkit for scraping in ubuntu server amazon Capybara::Webkit::ConnectionError (/path/webkit_server failed to start.):


I have this code in my controller:

browser = Capybara.current_session
browser.visit url[0]

And it gets error in visit method.

I've installed lib qt5 in my server, i know that i need to use an xserver, but i've installed without changes in the log.

Any suggestions? I think is a server configuration or lib. PD: in development mode, in my laptop, everything works perfectly, it brokes in production mode.


Solution

  • Thank's guys for giving me clues. 1. Change webkit to poltergeist gem. It have the same result, but better functionality in servers. https://github.com/teampoltergeist/poltergeist 2. Install phantomjs (dependency for poltergeist) by binaries. https://github.com/teampoltergeist/poltergeist#installing-phantomjs

    And that's all.