Forum: Ruby require problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C0ec5a090e5df61f717849e6846d5246?d=identicon&s=25 Ernest Obusek (Guest)
on 2006-04-22 20: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
(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
Be13d49ea40add75e564bef96b323caf?d=identicon&s=25 13 (Guest)
on 2006-04-22 20:25
(Received via mailing list)
Hi,

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

require 'rubygems'
require 'mechanize'

# use WWW::Mechanize

--
Martins
This topic is locked and can not be replied to.