Forum: Ruby on Rails www::mechanize help

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.
Manish S. (Guest)
on 2006-03-22 23:35
(Received via mailing list)
I installed the gem for WWW::Mechanize and the installer said it
successfully.  I tried to create a test ruby script to see if it works
and i
get this error:

mechanize-test.rb:1:in `require': no such file to load -- mechanize
        from lib/tasks/mechanize-test.rb:1

Am i doing something wrong? What is the proper way to require external
classes in ruby? Futhermore in a rails project?  Anyone worked with
mechanize before?  please help.

Here is the test script (which i copied from the example given on the
creator's, Mike Neuman?, blog)

require 'mechanize'

agent = {|a| a.log = }
page = agent.get('')
link = page.links.find {|l| l.node.text =~ /Log In/ }
page =
form = page.forms[1]
form.fields.find {|f| == 'form_loginname'}.value = ARGV[0]
form.fields.find {|f| == 'form_pw'}.value = ARGV[1]
page = agent.submit(form, form.buttons.first)
puts page.body
This topic is locked and can not be replied to.