在 ubuntu 服务器亚马逊 Capybara::Webkit::ConnectionError 中使用 capybara-webkit 进行抓取时出错(/path/webkit_server 无法启动。):
Error using capybara-webkit for scraping in ubuntu server amazon Capybara::Webkit::ConnectionError (/path/webkit_server failed to start.):
我的控制器中有这段代码:
browser = Capybara.current_session
browser.visit url[0]
访问方法出错
我已经在我的服务器上安装了 lib qt5,我知道我需要使用 xserver,但是我在日志中没有更改就安装了。
有什么建议吗?我认为是服务器配置或库。
PD:在开发模式下,在我的笔记本电脑上,一切正常,但在生产模式下就坏了。
谢谢大家给我线索。
1. 将 webkit 更改为 poltergeist gem。它具有相同的结果,但在服务器中具有更好的功能。 https://github.com/teampoltergeist/poltergeist
2. 通过二进制文件安装 phantomjs(poltergeist 的依赖项)。 https://github.com/teampoltergeist/poltergeist#installing-phantomjs
仅此而已。
我的控制器中有这段代码:
browser = Capybara.current_session
browser.visit url[0]
访问方法出错
我已经在我的服务器上安装了 lib qt5,我知道我需要使用 xserver,但是我在日志中没有更改就安装了。
有什么建议吗?我认为是服务器配置或库。 PD:在开发模式下,在我的笔记本电脑上,一切正常,但在生产模式下就坏了。
谢谢大家给我线索。 1. 将 webkit 更改为 poltergeist gem。它具有相同的结果,但在服务器中具有更好的功能。 https://github.com/teampoltergeist/poltergeist 2. 通过二进制文件安装 phantomjs(poltergeist 的依赖项)。 https://github.com/teampoltergeist/poltergeist#installing-phantomjs
仅此而已。