Ruby - Watir - PhantomJS

浪子不回头ぞ 提交于 2019-12-24 13:52:57

问题


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!


回答1:


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/




回答2:


You may install phantomjs as a gem.



来源:https://stackoverflow.com/questions/35529262/ruby-watir-phantomjs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!