Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby - require 'watir-webdriver' - generates a LoadError no such file... Why?

I am new to Ruby and would really appreciate some help understanding what is going on here.
Summary:

Gem install watir-webdriver
Installs fine
start irb
require "watir-webdriver"
... LoadError: no such file to load --watir-webdriver

Surely this should respond

=> true

Why is it not finding the gem? Or what am I doing wrong?

Console

I'm on win7, Railsinstaller (Ruby 1.8.7).

like image 680
Dirk Avatar asked Nov 09 '11 13:11

Dirk


1 Answers

In 1.8.7 you need to require rubygems first.

require 'rubygems'

Some explanation here: How does require rubygems help find rubygem files?

like image 188
Steve Avatar answered May 16 '23 08:05

Steve