# Mechanize for Ruby on Linux not working

**URL:** <https://www.ruby-forum.com/t/mechanize-for-ruby-on-linux-not-working/148479>\
**Category:** Ruby\
**Created:** [September 13, 2008, 10:02am UTC](https://www.ruby-forum.com/t/mechanize-for-ruby-on-linux-not-working/148479 "2008-09-13T10:02:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![maz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@maz](https://www.ruby-forum.com/u/maz)\
**Post date:** [September 13, 2008, 10:02am UTC](https://www.ruby-forum.com/t/mechanize-for-ruby-on-linux-not-working/148479/1 "2008-09-13T10:02:05Z")

</div>

The administrator for a server I’m using tried installing Mechanize for  
Ruby using the gem installer. Gem claims that the installation worked  
except that programs trying to use it disagree. Programs trying to use  
Mechanize get this error:

in ‘require’: no such file to load – mechanize (LoadError)

```
Does anyone know what's going wrong? Maybe something hasn't been 

```

given  
the right permissions? Maybe gems aren’t the way to install modules for  
public use?  
Any help is greatly appreciated, thank you…

---

<div class="post-metadata">

**Author:** ![maz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@maz](https://www.ruby-forum.com/u/maz)\
**Post date:** [September 13, 2008, 10:33am UTC](https://www.ruby-forum.com/t/mechanize-for-ruby-on-linux-not-working/148479/2 "2008-09-13T10:33:07Z")

</div>

Alle Saturday 13 September 2008, Just Another Victim of the Ambient  
Morality  
ha scritto:

> ```
> Any help is greatly appreciated, thank you...
> 
> ```

Before requiring files installed using rubygems, you need to either  
require  
‘rubygems’ or add -rrubygems to the RUBYOPT environment variable. Not  
doing  
one of these things will give the error you reported.

I hope this helps

Stefano

---

<div class="post-metadata">

**Author:** ![maz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@maz](https://www.ruby-forum.com/u/maz)\
**Post date:** [September 13, 2008, 7:20pm UTC](https://www.ruby-forum.com/t/mechanize-for-ruby-on-linux-not-working/148479/3 "2008-09-13T19:20:48Z")

</div>

“Stefano C.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote in message  
news:removed\_email\_address@domain.invalid…

> > 
> 
> one of these things will give the error you reported.
> 
> I hope this helps

```
I think it has! I haven't written a program that uses these modules 

```

in  
earnest yet but my simple test program would suggest that it’s working.  
I’m  
guessing the Windows installer must set this environment variable  
automatically and that’s why I’ve never heard of this, before…  
Just to solidify my understanding, if this module had not been  
installed  
using rubygems, would a simple require have worked?  
Thanks again!

---

<div class="post-metadata">

**Author:** ![maz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@maz](https://www.ruby-forum.com/u/maz)\
**Post date:** [September 14, 2008, 9:25pm UTC](https://www.ruby-forum.com/t/mechanize-for-ruby-on-linux-not-working/148479/4 "2008-09-14T21:25:19Z")

</div>

On Sat, Sep 13, 2008 at 12:13 PM, Just Another Victim of the Ambient  
Morality [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > Mechanize get this error:  
> > > require  
> > > Just to solidify my understanding, if this module had not been installed  
> > > using rubygems, would a simple require have worked?  
> > > Thanks again!

yes.

Cameron
