I got 'sudo gem install mechanize' to work but this solution didn't go for me 100%. I had to add anything from sudo apt-get install for libxslt
include the following to that large apt-get install list:
libxslt-ruby libxslt-ruby1.8 libxslt1.1 libxslt1-dev libxslt1-dbg
afterwards 'sudo gem install mechanize' loaded 2 gems, mechanize and nokogiri
Otherwise you'll get the following errors
Code:
sudo gem install mechanize
Building native extensions. This could take a while...
ERROR: Error installing mechanize:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb install mechanize
checking for xmlParseDoc() in -lxml2... yes
checking for xsltParseStylesheetDoc() in -lxslt... no
checking for exsltFuncRegister() in -lexslt... no
checking for libxml/xmlversion.h in /opt/local/include,/opt/local/include/libxml2,/usr/include/libxml2,/usr/include,/usr/include/libxml2,/usr/local/include/libxml2... yes
checking for libxslt/xslt.h in /opt/local/include,/opt/local/include/libxml2,/usr/include/libxml2,/usr/include,/usr/include/libxml2,/usr/local/include/libxml2... no
need libxslt
*** 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.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby1.8
--with-xml2lib
--without-xml2lib
--with-xsltlib
--without-xsltlib
--with-exsltlib
--without-exsltlib
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/nokogiri-1.1.0 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/nokogiri-1.1.0/ext/nokogiri/gem_make.out
cheers
Bookmarks