# Problems getting Mechanize working

**URL:** <https://rubytalk.org/t/problems-getting-mechanize-working/40150>\
**Category:** ruby-talk\
**Created:** [23 August 2007 20:38 UTC](https://rubytalk.org/t/problems-getting-mechanize-working/40150 "2007-08-23T20:38:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergio\_Ruiz](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@Sergio\_Ruiz](https://rubytalk.org/u/Sergio_Ruiz)\
**Post date:** [23 August 2007 20:38 UTC](https://rubytalk.org/t/problems-getting-mechanize-working/40150/1 "2007-08-23T20:38:18Z")

</div>

i am trying to get mechanize to work, but i am getting the following  
error..

does anyone have any ideas?

this happens in irb and while running scripts.. if i do an  
agent.methods, i get not 'get' in the list either..

very weird..

i would appreciate any help

thanks!

irb(main):009:0\> agent = WWW::Mechanize.new  
=\> #\<WWW::Mechanize:0x21960ac\>  
irb(main):010:0\> agent.get('[http://google.com/](http://google.com/)')  
NoMethodError: undefined method `get' for #\<WWW::Mechanize:0x21960ac\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from (irb):10  
irb(main):011:0\>

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Jan\_Svitok](https://avatars.discourse-cdn.com/v4/letter/j/cab0a1/32.png) [@Jan\_Svitok](https://rubytalk.org/u/Jan_Svitok)\
**Post date:** [24 August 2007 19:09 UTC](https://rubytalk.org/t/problems-getting-mechanize-working/40150/2 "2007-08-24T19:09:40Z")

</div>

I don't know much about mechanize, but this code worked for me. (with  
additional require 'mechanize' before)

Try reinstalling mechanize, or run test\_all.rb in mechanize's test  
directory to check your installation.

Are you requiring the top-level mechanize.rb?

> **···**
>
> On 8/23/07, Sergio Ruiz \<sergio@village-buzz.com\> wrote:
> 
> > i am trying to get mechanize to work, but i am getting the following  
> > error..
> > 
> > does anyone have any ideas?
> > 
> > this happens in irb and while running scripts.. if i do an  
> > agent.methods, i get not 'get' in the list either..
> > 
> > very weird..
> > 
> > i would appreciate any help
> > 
> > thanks!
> > 
> > irb(main):009:0\> agent = WWW::Mechanize.new  
> > =\> #\<WWW::Mechanize:0x21960ac\>  
> > irb(main):010:0\> agent.get('[http://google.com/&#39;\](http://google.com/&#39;%5C))  
> > NoMethodError: undefined method `get' for #\<WWW::Mechanize:0x21960ac\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from (irb):10  
> > irb(main):011:0\>

---

<div class="post-metadata">

**Author:** ![Sergio\_Ruiz](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@Sergio\_Ruiz](https://rubytalk.org/u/Sergio_Ruiz)\
**Post date:** [24 August 2007 19:29 UTC](https://rubytalk.org/t/problems-getting-mechanize-working/40150/3 "2007-08-24T19:29:18Z")

</div>

> I don't know much about mechanize, but this code worked for me. (with  
> additional require 'mechanize' before)

yes, i did do that..

> Try reinstalling mechanize, or run test\_all.rb in mechanize's test  
> directory to check your installation.

let me try this..

> Are you requiring the top-level mechanize.rb?

how would i test this?

thanks!

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Jan\_Svitok](https://avatars.discourse-cdn.com/v4/letter/j/cab0a1/32.png) [@Jan\_Svitok](https://rubytalk.org/u/Jan_Svitok)\
**Post date:** [24 August 2007 19:49 UTC](https://rubytalk.org/t/problems-getting-mechanize-working/40150/4 "2007-08-24T19:49:38Z")

</div>

I meant whether do you require 'mechanize' or 'mechanize/something'...

There might be other causes, but my irb displays whole bunch of  
members after Mechanize.new ( \<WWW::Mechanize:0xer432432 @dfdsf=...  
@dfsfs=... \>).

> **···**
>
> On 8/24/07, Sergio Ruiz \<sergio@village-buzz.com\> wrote:
> 
> > \> I don't know much about mechanize, but this code worked for me. (with  
> > \> additional require 'mechanize' before)  
> > \>
> > 
> > yes, i did do that..
> > 
> > \> Try reinstalling mechanize, or run test\_all.rb in mechanize's test  
> > \> directory to check your installation.  
> > \>
> > 
> > let me try this..
> > 
> > \> Are you requiring the top-level mechanize.rb?
> > 
> > how would i test this?

---

<div class="post-metadata">

**Author:** ![Sergio\_Ruiz](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@Sergio\_Ruiz](https://rubytalk.org/u/Sergio_Ruiz)\
**Post date:** [24 August 2007 19:55 UTC](https://rubytalk.org/t/problems-getting-mechanize-working/40150/5 "2007-08-24T19:55:32Z")

</div>

> I meant whether do you require 'mechanize' or 'mechanize/something'...

yeah.. i do this..

> There might be other causes, but my irb displays whole bunch of  
> members after Mechanize.new ( \<WWW::Mechanize:0xer432432 @dfdsf=...  
> @dfsfs=... \>).

hmmm.. mine almost seems like it's working with a different mechanize..

trying to figure out where the code for the gems is installed..

hmm

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
