简体   繁体   中英

Ruby - Watir - PhantomJS

I'm on debian. I have ruby set up with bundle. I do

sudo gem install watir-webdriver
sudo gem install phantomjs

Then I add both to my Gemfile. Then I do bundle install. Then I run ruby code

Watir::Browser.new(:phantomjs)

and get this error:

/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)

How do I make this work? Thanks!

you don't have phantomjs installed correctly (or at all), so when your program tries to open phantomjs, it cant find it.

try this http://www.netdip.com/install-phantomjs-1422766836/

您可以将phantomjs作为gem安装。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM