Put your message here! Contact me for more information
 
 








 

I wanted to give mechanize a shot for a small prototype I was building.  It’s been a while since I last ran the gem command so of course the first thing it would do was to update itself.  For some reason, it got stuck forever.  It turned out that the latest hpricot gem was trying to build itself from source (! - very strange!) and gem updater got stuck looking for a compatible compiler.

So I downloaded the mechanize gem from Rubyforge instead and ran

gem install mechanize-0.7.7.gem

However, the gem still tried to access the gem index and eventually got stuck somewhere.  The ruby runtime ballooned up to more than 600MB as showed in Task Manager.  I dug up the gem install command and it turns out the gem install can be forced to install without checking the dependencies and without updaing the local index.   So the final gem command is

gem install mechanize-0.7.7.gem –no-ri –no-rdoc -f –no-update-sources

With the –no-update-sources flag, the gem won’t try to go off to http://gems.rubyforge.org and get the latest repository info but expecting there is already a local gem file.

Hope this help someone :)


Tags: , , , ,

 

2 Responses to “Installing mechanize-0.7.7 on Windows



12:39 pm
August 20, 2008
#200779

Hi! I was having issues installing mechanize on my windows box today, and came across your blog post. I followed your advice, downloaded the mechanize gem to my local dir, fired up a console in _that_ directory and issued your command. I keep getting the same error -

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.

Something I am missing?




12:59 pm
August 20, 2008
#200786

In your case, I would say the gem installer is still trying to compile some dependencies, most probably the new hpricot gem.

I would make sure that the hpricot library is good. Currently I have
- hpricot 0.6, 0.6.161, 0.6-mswìn, and 0.6-x86-mswin32 installed. You may need to get the latest one hpricot installed, then re-try installing mechanize.

Good luck!




 

Leave a Reply