# Cannot load watir

**URL:** <https://rubytalk.org/t/cannot-load-watir/60570>\
**Category:** ruby-talk\
**Created:** [22 October 2010 16:05 UTC](https://rubytalk.org/t/cannot-load-watir/60570 "2010-10-22T16:05:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Junkone](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@Junkone](https://rubytalk.org/u/Junkone)\
**Post date:** [22 October 2010 16:05 UTC](https://rubytalk.org/t/cannot-load-watir/60570/1 "2010-10-22T16:05:15Z")

</div>

as you can see, i have the watir gem installed but cannot load it in  
irb. dont know how to troubleshoot this.

U:\\>irb  
irb(main):001:0\> require 'watir'  
LoadError: no such file to load -- watir  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from (irb):1:in `require'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from (irb):1  
irb(main):002:0\> exit

U:\\>gem list --local watir

\*\*\* LOCAL GEMS \*\*\*

watir (1.6.6)

U:\\>ruby -v  
ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]

U:\\>irb  
irb(main):001:0\> require 'watir'  
LoadError: no such file to load -- watir  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from (irb):1:in `require'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from (irb):1  
irb(main):002:0\>

---

<div class="post-metadata">

**Author:** ![Junkone](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@Junkone](https://rubytalk.org/u/Junkone)\
**Post date:** [22 October 2010 16:10 UTC](https://rubytalk.org/t/cannot-load-watir/60570/2 "2010-10-22T16:10:13Z")

</div>

i made it to work by loading rubygems first.

U:\\>irb  
irb(main):001:0\> require 'watir'  
LoadError: no such file to load -- watir  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from (irb):1:in `require'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from (irb):1  
irb(main):002:0\> require 'rubygems'  
=\> true  
irb(main):003:0\> require 'watir'  
=\> true  
irb(main):004:0\>

However, i never had to load rubygems before. the script i am running  
was working before i reimaged my machine and reloaded ruby. what did i  
miss in my install that i have to require 'rubygems' now.

> **···**
>
> On Oct 22, 12:03 pm, Junkone \<junko...@gmail.com\> wrote:
> 
> > as you can see, i have the watir gem installed but cannot load it in  
> > irb. dont know how to troubleshoot this.
> > 
> > U:\\>irb  
> > irb(main):001:0\> require 'watir'  
> > LoadError: no such file to load -- watir  
> > from (irb):1:in `require'  
> > from (irb):1  
> > irb(main):002:0\> exit
> > 
> > U:\\>gem list --local watir
> > 
> > \*\*\* LOCAL GEMS \*\*\*
> > 
> > watir (1.6.6)
> > 
> > U:\\>ruby -v  
> > ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]
> > 
> > U:\\>irb  
> > irb(main):001:0\> require 'watir'  
> > LoadError: no such file to load -- watir  
> > from (irb):1:in `require'  
> > from (irb):1  
> > irb(main):002:0\>

---

<div class="post-metadata">

**Author:** ![Bret\_Pettichord1](https://avatars.discourse-cdn.com/v4/letter/b/258eb7/32.png) [@Bret\_Pettichord1](https://rubytalk.org/u/Bret_Pettichord1)\
**Post date:** [22 October 2010 16:13 UTC](https://rubytalk.org/t/cannot-load-watir/60570/3 "2010-10-22T16:13:21Z")

</div>

require 'rubygems'  
require 'watir'

> **···**
>
> On Fri, Oct 22, 2010 at 11:05 AM, Junkone \<junkone1@gmail.com\> wrote:
> 
> > as you can see, i have the watir gem installed but cannot load it in  
> > irb. dont know how to troubleshoot this.
> > 
> > U:\\>irb  
> > irb(main):001:0\> require 'watir'  
> > LoadError: no such file to load -- watir  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from (irb):1:in `require'  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from (irb):1  
> > irb(main):002:0\> exit
> > 
> > U:\\>gem list --local watir
> > 
> > \*\*\* LOCAL GEMS \*\*\*
> > 
> > watir (1.6.6)
> > 
> > U:\\>ruby -v  
> > ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]
> > 
> > U:\\>irb  
> > irb(main):001:0\> require 'watir'  
> > LoadError: no such file to load -- watir  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from (irb):1:in `require'  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from (irb):1  
> > irb(main):002:0\>
> 
> --  
> Bret Pettichord  
> Lead Developer, Watir, [www.watir.com](http://www.watir.com)
> 
> Blog, [www.io.com/~wazmo/blog](http://www.io.com/~wazmo/blog)  
> Twitter, [www.twitter.com/bpettichord](http://www.twitter.com/bpettichord)

---

<div class="post-metadata">

**Author:** ![Bret\_Pettichord1](https://avatars.discourse-cdn.com/v4/letter/b/258eb7/32.png) [@Bret\_Pettichord1](https://rubytalk.org/u/Bret_Pettichord1)\
**Post date:** [22 October 2010 16:14 UTC](https://rubytalk.org/t/cannot-load-watir/60570/4 "2010-10-22T16:14:15Z")

</div>

There is an environment variable that automatically loads rubygems.

> **···**
>
> On Fri, Oct 22, 2010 at 11:10 AM, Junkone \<junkone1@gmail.com\> wrote:
> 
> > On Oct 22, 12:03 pm, Junkone \<junko...@gmail.com\> wrote:  
> > \> as you can see, i have the watir gem installed but cannot load it in  
> > \> irb. dont know how to troubleshoot this.  
> > \>  
> > \> U:\\>irb  
> > \> irb(main):001:0\> require 'watir'  
> > \> LoadError: no such file to load -- watir  
> > \> from (irb):1:in `require'  
> > \> from (irb):1  
> > \> irb(main):002:0\> exit  
> > \>  
> > \> U:\\>gem list --local watir  
> > \>  
> > \> \*\*\* LOCAL GEMS \*\*\*  
> > \>  
> > \> watir (1.6.6)  
> > \>  
> > \> U:\\>ruby -v  
> > \> ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]  
> > \>  
> > \> U:\\>irb  
> > \> irb(main):001:0\> require 'watir'  
> > \> LoadError: no such file to load -- watir  
> > \> from (irb):1:in `require'  
> > \> from (irb):1  
> > \> irb(main):002:0\>
> > 
> > i made it to work by loading rubygems first.
> > 
> > U:\\>irb  
> > irb(main):001:0\> require 'watir'  
> > LoadError: no such file to load -- watir  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from (irb):1:in `require'  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from (irb):1  
> > irb(main):002:0\> require 'rubygems'  
> > =\> true  
> > irb(main):003:0\> require 'watir'  
> > =\> true  
> > irb(main):004:0\>
> > 
> > However, i never had to load rubygems before. the script i am running  
> > was working before i reimaged my machine and reloaded ruby. what did i  
> > miss in my install that i have to require 'rubygems' now.
> 
> --  
> Bret Pettichord  
> Lead Developer, Watir, [www.watir.com](http://www.watir.com)
> 
> Blog, [www.io.com/~wazmo/blog](http://www.io.com/~wazmo/blog)  
> Twitter, [www.twitter.com/bpettichord](http://www.twitter.com/bpettichord)

---

<div class="post-metadata">

**Author:** ![Luis\_Lavena1](https://avatars.discourse-cdn.com/v4/letter/l/f08c70/32.png) [@Luis\_Lavena1](https://rubytalk.org/u/Luis_Lavena1)\
**Post date:** [22 October 2010 16:20 UTC](https://rubytalk.org/t/cannot-load-watir/60570/5 "2010-10-22T16:20:12Z")

</div>

Perhaps your old system had the following environment variable:  
RUBYOPT=rubygems setup.

> **···**
>
> On Oct 22, 1:06 pm, Junkone \<junko...@gmail.com\> wrote:
> 
> > However, i never had to load rubygems before. the script i am running  
> > was working before i reimaged my machine and reloaded ruby. what did i  
> > miss in my install that i have to require 'rubygems' now.
> 
> --  
> Luis Lavena

---

<div class="post-metadata">

**Author:** ![Junkone](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@Junkone](https://rubytalk.org/u/Junkone)\
**Post date:** [22 October 2010 16:50 UTC](https://rubytalk.org/t/cannot-load-watir/60570/6 "2010-10-22T16:50:12Z")

</div>

last time, i used 1 click intaller. not this time. so i probably have  
to setup the environment variable. How does it look like.  
RUBYOPTS=\<WHAT SHOULD I PUT HERE\>

> **···**
>
> On Oct 22, 12:17 pm, Luis Lavena \<luislav...@gmail.com\> wrote:
> 
> > On Oct 22, 1:06 pm, Junkone \<junko...@gmail.com\> wrote:
> > 
> > \> However, i never had to load rubygems before. the script i am running  
> > \> was working before i reimaged my machine and reloaded ruby. what did i  
> > \> miss in my install that i have to require 'rubygems' now.
> > 
> > Perhaps your old system had the following environment variable:  
> > RUBYOPT=rubygems setup.
> > 
> > --  
> > Luis Lavena

---

<div class="post-metadata">

**Author:** ![Luis\_Lavena1](https://avatars.discourse-cdn.com/v4/letter/l/f08c70/32.png) [@Luis\_Lavena1](https://rubytalk.org/u/Luis_Lavena1)\
**Post date:** [22 October 2010 18:27 UTC](https://rubytalk.org/t/cannot-load-watir/60570/7 "2010-10-22T18:27:38Z")

</div>

RubyInstaller no longer adds RUBYOPT

See above, I showed you what RUBYOPT should be set to.

> **···**
>
> On Oct 22, 1:45 pm, Junkone \<junko...@gmail.com\> wrote:
> 
> > On Oct 22, 12:17 pm, Luis Lavena \<luislav...@gmail.com\> wrote:
> > 
> > \> On Oct 22, 1:06 pm, Junkone \<junko...@gmail.com\> wrote:
> > 
> > \> \> However, i never had to load rubygems before. the script i am running  
> > \> \> was working before i reimaged my machine and reloaded ruby. what did i  
> > \> \> miss in my install that i have to require 'rubygems' now.
> > 
> > \> Perhaps your old system had the following environment variable:  
> > \> RUBYOPT=rubygems setup.
> > 
> > \> --  
> > \> Luis Lavena
> > 
> > last time, i used 1 click intaller. not this time. so i probably have  
> > to setup the environment variable. How does it look like.  
> > RUBYOPTS=\<WHAT SHOULD I PUT HERE\>
> 
> --  
> Luis Lavena

---

<div class="post-metadata">

**Author:** ![Junkone](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@Junkone](https://rubytalk.org/u/Junkone)\
**Post date:** [22 October 2010 21:35 UTC](https://rubytalk.org/t/cannot-load-watir/60570/8 "2010-10-22T21:35:13Z")

</div>

this actually works.  
RUBYOPT=rubygems  
this did not work  
RUBYOPT=rubygems setup

> **···**
>
> On Oct 22, 2:21 pm, Luis Lavena \<luislav...@gmail.com\> wrote:
> 
> > On Oct 22, 1:45 pm, Junkone \<junko...@gmail.com\> wrote:
> > 
> > \> On Oct 22, 12:17 pm, Luis Lavena \<luislav...@gmail.com\> wrote:
> > 
> > \> \> On Oct 22, 1:06 pm, Junkone \<junko...@gmail.com\> wrote:
> > 
> > \> \> \> However, i never had to load rubygems before. the script i am running  
> > \> \> \> was working before i reimaged my machine and reloaded ruby. what did i  
> > \> \> \> miss in my install that i have to require 'rubygems' now.
> > 
> > \> \> Perhaps your old system had the following environment variable:  
> > \> \> RUBYOPT=rubygems setup.
> > 
> > \> \> --  
> > \> \> Luis Lavena
> > 
> > \> last time, i used 1 click intaller. not this time. so i probably have  
> > \> to setup the environment variable. How does it look like.  
> > \> RUBYOPTS=\<WHAT SHOULD I PUT HERE\>
> > 
> > RubyInstaller no longer adds RUBYOPT
> > 
> > See above, I showed you what RUBYOPT should be set to.
> > 
> > --  
> > Luis Lavena
