# Require problem

**URL:** <https://www.ruby-forum.com/t/require-problem/58534>\
**Category:** Ruby\
**Created:** [April 22, 2006, 8:16pm UTC](https://www.ruby-forum.com/t/require-problem/58534 "2006-04-22T20:16:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ernest\_Obusek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c68b51/32.png) [@Ernest\_Obusek](https://www.ruby-forum.com/u/Ernest_Obusek)\
**Post date:** [April 22, 2006, 8:16pm UTC](https://www.ruby-forum.com/t/require-problem/58534/1 "2006-04-22T20:16:17Z")

</div>

I’m trying to use the WWW::Mechanize library and I created a short  
script for it. When I run it I get an error saying:

./getfindata.rb:3:in `require’: No such file to load – mechanize  
(LoadError)  
from ./getfindata.rb:3

caused by the line:

require ‘mechanize’

which I got from an online example.

But if I do a gem list I see:

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

mechanize (0.4.0, 0.3.1)  
Mechanize provides automated web-browsing

narf (0.7.3)  
NARF is a replacement for and derivative of the Ruby CGI  
library. It  
exists to trivialize web development .

sources (0.0.1)  
This package provides download sources for remote gem installation

So I’m clueless as to what is wrong.

Thanks for any help you can give me!

Ernest

---

<div class="post-metadata">

**Author:** ![Ernest\_Obusek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c68b51/32.png) [@Ernest\_Obusek](https://www.ruby-forum.com/u/Ernest_Obusek)\
**Post date:** [April 22, 2006, 8:25pm UTC](https://www.ruby-forum.com/t/require-problem/58534/2 "2006-04-22T20:25:25Z")

</div>

Hi,

First try to require rubygems and then require mechanize, like this:

require ‘rubygems’  
require ‘mechanize’

# use WWW::Mechanize

–  
Martins
