Mechanize problem, cant require nor install

Hi Im following the simple mechanize tutorial on
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:inrequire’
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?

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!

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 ?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs