【问题标题】:Ruby - Watir - PhantomJSRuby - Watir - PhantomJS
【发布时间】:2016-02-20 21:26:25
【问题描述】:

我在 debian 上。我已经用 bundle 设置了 ruby​​。我愿意

sudo gem install watir-webdriver
sudo gem install phantomjs

然后我将两者都添加到我的 Gemfile 中。然后我做捆绑安装。然后我运行 ruby​​ 代码

Watir::Browser.new(:phantomjs)

并得到这个错误:

/var/lib/gems/2.1.0/gems/selenium-webdriver-2.52.0/lib/selenium/webdriver/phantomjs/service.rb:38:in `executable_path': Unable to find phantomjs executable. (Selenium::WebDriver::Error::WebDriverError)

我该如何进行这项工作?谢谢!

【问题讨论】:

    标签: ruby linux phantomjs watir


    【解决方案1】:

    您没有正确(或根本没有)安装 phantomjs,所以当您的程序尝试打开 phantomjs 时,它找不到它。

    试试这个 http://www.netdip.com/install-phantomjs-1422766836/

    【讨论】:

    • 那个页面是404。
    【解决方案2】:

    您可以将 phantomjs 安装为 gem。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-02-16
      • 2014-10-27
      • 1970-01-01
      • 2016-03-12
      • 1970-01-01
      • 2023-04-05
      • 2016-12-15
      • 2015-04-04
      相关资源
      最近更新 更多