# Mechanize problem, cant require nor install

**URL:** <https://www.ruby-forum.com/t/mechanize-problem-cant-require-nor-install/146268>\
**Category:** Ruby\
**Created:** [August 19, 2008, 5:32pm UTC](https://www.ruby-forum.com/t/mechanize-problem-cant-require-nor-install/146268 "2008-08-19T17:32:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![scudco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@scudco](https://www.ruby-forum.com/u/scudco)\
**Post date:** [August 19, 2008, 5:32pm UTC](https://www.ruby-forum.com/t/mechanize-problem-cant-require-nor-install/146268/1 "2008-08-19T17:32:12Z")

</div>

Hi Im following the simple mechanize tutorial on  
[http://ruby-doc.org/core/](http://ruby-doc.org/core/)  
i fire up irb  
then type and see the following

irb(main):001:0\> require ‘rubygems’  
=\> true  
irb(main):002:0\> require ‘mechanize’  
LoadError: no such file to load – mechanize  
from  
C:/InstantRails\_Ver2/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_re  
quire.rb:27:in `gem_original_require' from C:/InstantRails_Ver2/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_re quire.rb:27:in `require’  
from (irb):2  
irb(main):003:0\>

so i tried to install it via rubygems but…

C:/InstantRails\_Ver2/ruby/bin/ruby.exe extconf.rb install mechanize  
–remote  
checking for stdio.h… no  
\*\*\* extconf.rb failed \*\*\*  
Could not create Makefile due to some reason, probably lack of  
necessary libraries and/or headers. Check the mkmf.log file for more  
details. You may need configuration options.

not sure whats going. This is my ruby version  
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

and im using Instant Rails

here is my gem list

actionmailer (2.0.2, 1.3.6)  
actionpack (2.0.2, 1.13.6)  
actionwebservice (1.2.6)  
activerecord (2.0.2, 1.15.6)  
activeresource (2.0.2)  
activesupport (2.0.2, 1.4.4)  
capistrano (2.1.0)  
cgi\_multipart\_eof\_fix (2.5.0)  
cmdparse (2.0.2)  
fxri (0.3.6)  
fxruby (1.6.12)  
gem\_plugin (0.2.3)  
highline (1.4.0)  
hpricot (0.6)  
log4r (1.0.5)  
mongrel (1.1.2)  
mysql (2.7.3)  
needle (1.3.0)  
net-sftp (1.1.0)  
net-ssh (1.1.2)  
rails (1.2.6)  
rake (0.8.1, 0.8.0, 0.7.3)  
rubygems-update (1.0.1)  
sources (0.0.1)  
sqlite3-ruby (1.2.1)  
win32-api (1.0.4)  
win32-clipboard (0.4.3)  
win32-dir (0.3.2)  
win32-eventlog (0.4.6)  
win32-file (0.5.4)  
win32-file-stat (1.2.7)  
win32-process (0.5.3)  
win32-sapi (0.1.4)  
win32-sound (0.4.1)  
windows-api (0.2.0)  
windows-pr (0.7.2)

anyone know how i can fix this?

---

<div class="post-metadata">

**Author:** ![scudco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@scudco](https://www.ruby-forum.com/u/scudco)\
**Post date:** [August 21, 2008, 5:56am UTC](https://www.ruby-forum.com/t/mechanize-problem-cant-require-nor-install/146268/2 "2008-08-21T05:56:55Z")

</div>

On Wed, Aug 20, 2008 at 12:28:44AM +0900, Adam A. wrote:

> ```
> from
> 
> ```
> 
> C:/InstantRails\_Ver2/ruby/bin/ruby.exe extconf.rb install mechanize  
> –remote  
> checking for stdio.h… no  
> \*\*\* extconf.rb failed \*\*\*  
> Could not create Makefile due to some reason, probably lack of  
> necessary libraries and/or headers. Check the mkmf.log file for more  
> details. You may need configuration options.

Don’t use extconf.rb to install gems. You need to use the “gem” command  
like so:

$ gem install mechanize

Hope that helps!

---

<div class="post-metadata">

**Author:** ![scudco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@scudco](https://www.ruby-forum.com/u/scudco)\
**Post date:** [August 21, 2008, 7:43am UTC](https://www.ruby-forum.com/t/mechanize-problem-cant-require-nor-install/146268/3 "2008-08-21T07:43:38Z")

</div>

even when installed with gem , I encounter a problem ( if it’s really a  
problem ) : if I step through my code ( ruby -rdebug code.rb ) , the  
debugger dies at the line ‘require “mechanize”’ ; I mention that I have  
included ‘require “rubygems”’ as the first line .  
However , if I set a breakpoint in my code , somewhere past that line ,  
I can reach it . Could someone give me an explanation please ?
