Forum: Ruby require problem

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ernest Obusek (Guest)
on 2006-04-22 22:16
(Received via mailing list)
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
         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!

13 (Guest)
on 2006-04-22 22:25
(Received via mailing list)

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

require 'rubygems'
require 'mechanize'

# use WWW::Mechanize

This topic is locked and can not be replied to.