require 'watir-webdriver' error

2019-09-08 17:39发布

问题:

I am trying to use Watir with Rails, and installed it, and when I use it from irb, it works fine. But when I try to include it in rails application, as

require 'rubygems'
require 'watir-webdriver'

I get the following error:

LoadError (no such file to load -- watir-webdriver)

Some people had experienced the same problem, which was solved by using require 'rubygems', butin my case, the problem still persists. Any idea?

回答1:

Did you add gem 'watir-webdriver' to your Gemfile in Rails root folder?