# Problems getting Mechanize working

**URL:** <https://www.ruby-forum.com/t/problems-getting-mechanize-working/112856>\
**Category:** Ruby\
**Created:** [August 23, 2007, 10:38pm UTC](https://www.ruby-forum.com/t/problems-getting-mechanize-working/112856 "2007-08-23T22:38:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![spacechurro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d2c977/32.png) [@spacechurro](https://www.ruby-forum.com/u/spacechurro)\
**Post date:** [August 23, 2007, 10:38pm UTC](https://www.ruby-forum.com/t/problems-getting-mechanize-working/112856/1 "2007-08-23T22:38:13Z")

</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  
from (irb):10  
irb(main):011:0\>

---

<div class="post-metadata">

**Author:** ![spacechurro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d2c977/32.png) [@spacechurro](https://www.ruby-forum.com/u/spacechurro)\
**Post date:** [August 24, 2007, 9:10pm UTC](https://www.ruby-forum.com/t/problems-getting-mechanize-working/112856/2 "2007-08-24T21:10:52Z")

</div>

On 8/23/07, Sergio R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 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  
> from (irb):10  
> irb(main):011:0\>

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?

---

<div class="post-metadata">

**Author:** ![spacechurro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d2c977/32.png) [@spacechurro](https://www.ruby-forum.com/u/spacechurro)\
**Post date:** [August 24, 2007, 9:29pm UTC](https://www.ruby-forum.com/t/problems-getting-mechanize-working/112856/3 "2007-08-24T21:29:13Z")

</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!

---

<div class="post-metadata">

**Author:** ![spacechurro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d2c977/32.png) [@spacechurro](https://www.ruby-forum.com/u/spacechurro)\
**Post date:** [August 24, 2007, 9:51pm UTC](https://www.ruby-forum.com/t/problems-getting-mechanize-working/112856/4 "2007-08-24T21:51:02Z")

</div>

On 8/24/07, Sergio R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> let me try this…
> 
> > Are you requiring the top-level mechanize.rb?
> 
> how would i test this?

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=… \>).

---

<div class="post-metadata">

**Author:** ![spacechurro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d2c977/32.png) [@spacechurro](https://www.ruby-forum.com/u/spacechurro)\
**Post date:** [August 24, 2007, 9:55pm UTC](https://www.ruby-forum.com/t/problems-getting-mechanize-working/112856/5 "2007-08-24T21:55:28Z")

</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
