How can I install ruby-xslt?


I can't figure how I to install ruby-xslt (downloaded from this page:

I am using MS Windows, ruby is installed using the 1-click installer.

When I decompress the archive, i can see there is a file named
I am a newbie, but I suppose this extconf.rb file has to be used to
install ?

When I launch extconf.rb, I get the following message:


checking for inflate() in z.lib... no extconf failure: need zlib

I have no clue what I should do to resolve this problem.
XSLT functionnalities are very important for me so any help would be
greatly appreciated.


Posted via

Please, could someone help me ?


Posted via

Have you been to:

It appears the easiest way is to just do a

gem install xml-tools


thank you for your quick response, I tried using gem, but

gem install xml-tools

gives me the following message:

Attempting local installation of 'xml-tools'
Local gem file not found: xml-tools*.gem
Attempting remote installation of 'xml-tools'
ERROR: While executing gem ... (Gem::GemNotFoundException)
    Could not find xml-tools (> 0) in the repository

XML-tools from your url seems to have everything I need: libxml and
But after I download the file libxml-ruby-2004-04-14.tgz (for example)
and I extract everything, when i try to launch extconf.rb, I get the
following errors:


checking for socket() in socket.lib... no
checking for gethostbyname() in nsl.lib... no
checking for atan() in m.lib... yes
checking for inflate() in z.lib... no
extconf failure: need zlib

What can I do to make extconf.rb work properly ? Am I missing something
Thanks for your help !

Daniel R

No. There is no gem for this stuff. You have to download and compile
each one manually --both libxml and libxsl.


I have the same type of problem with the mySQL gem on my Mac every

I'm not familiar with Windows so much anymore, but it sounds like you
need a Windows version of zlib and socket utilities. Generally, it is
looking for C header files from the development tools because the
output of extconf is a Makefile to build the gem (at least from what I
understand of the gem install process, don't flame me for misspeaking

Check the extconf.rb file -- for example, with mySQL gem, I have to do:

gem install mysql -- --with-config

The extra '--' tells it that options are coming, and --with-config
tells the mySQL gem to use the mysql configuration widget to get to my
installation. And it will pass these options down to the extconf.rb --
so check to see what options are available in the extconf.rb by opening
and examining it. It'll also give you an idea of where it is looking
for those files. The options available are going to be dependent on
what gem you are installing.

It may also be that a build of the gem is not available for Windows
because of these library dependencies.

Hope that helps some.


checking for inflate() in z.lib... no
extconf failure: need zlib
What can I do to make extconf.rb work properly ? Am I missing something?
Thanks for your help !

You need to have zlib installed. What platform are you running?


Oh, ok.
But I don't know how to compile. Could you give me some more
informations please ?
Thank you, I appreciate your help very much.

Daniel R

ok, but I don't know how I can compile them. Could you give me some
explanations about this ?
Thank you, I appreciate your help very much.

Daniel R

frugalprogrammer, I would like to thank you very much for your help
but... I'm lost.

Here is the content of the extconf.rb file. I have inspected it but I
don't see anything that would help. Maybe would you give me some advice
from looking at the file contents?


#!/usr/bin/env ruby

require 'mkmf'

if defined?(CFLAGS)

def crash(str)
  printf(" extconf failure: %s\n", str)
  exit 1



unless have_library('m', 'atan')
  crash('need libm')

unless have_library('z', 'inflate')
  crash('need zlib')

unless have_library('iconv','iconv_open') or
have_library('c','iconv_open') or
need libiconv.

  Install the libiconv or try passing one of the following options
  to extconf.rb:


unless have_library('xml2', 'xmlParseDoc')
need libxml2.

        Install the library or try one of the following options to


unless have_library('xml2', 'xmlDocFormatDump')
  crash('Your version of libxml2 is too old. Please upgrade.')

unless have_func('docbCreateFileParserCtxt')
  crash('Need docbCreateFileParserCtxt')

$LDFLAGS << ' ' + `xslt-config --libs`.chomp
$LDFLAGS << ' ' + `xml2-config --libs`.chomp

$CFLAGS << ' ' + `xslt-config --cflags`.chomp
$CFLAGS << ' ' + `xml2-config --cflags`.chomp
$CFLAGS = '-g -Wall ' + $CFLAGS


Daniel R

Okay, well that'll be a little bit tricker cause I use Linux but lets
see what we can do. You have the prereqs?

  *) libm
  *) libz (zlib)
  *) libiconv
  *) libxml2

Here some helpful links:

If you have tourble with iconv look here:

I'm not sure about libm though. Anyone else know libm on Windows?

You may check here You
will need the gnu win32 compiler(s), however much a contradiction in
terms that may be

The installation of this seems to be quite difficult on a windows box.
If this is a pressing need, I would look at other options.



1) libm: no problem, ruby already has it installed by default

2) libz (zlib): installed from your url
( I ran the
executable which created the folder "Program Files\GnuWin32" with
following folders:
- bin
- contrib
- doc
- include
- lib
- man
- manifest
- uninstall
The bin folder contains the file "zlib1.dll", which already was
existing in the ruby\bin folder from the defeult ruby installation.

Anyway, when I start extconf.rb, I still get the error
  checking for inflate() in z.lib... no

3)libiconv: installed from your URL, seems ok

  extconf failure: need zlib

So installing gnuwin32 zlib didn't help.

4)libxml2: ok, downloaded, unpacked and put to the same folder as libz.

I still can't figure how I can make zlib work properly. What is strange
is that there was already a file named zlib1.dll in the ruby\lib folder
.... anyway, each extconf.rb file I tested gave me the same "need zlib"

There is some progress, but it is still not working. Anyway, thank you
again for your help. I hope we will solve all these problems finally.

You are right, installation seems quite difficult on windows, so it
could be a good reason to switch to another operating system.
But I have searched extensively for aswers to these problems before
posting here, and I found no helpful informations.
Anyway these problems seem quite basic to me, and it's probable other
people will soon have the same problems. If we find solutions and post
the details here, it can be of great help for people who want to begin
using ruby on a windows box.

Wish I could help more, but I'm not familiar with compiling software on
Windows myself. But please inform us if you have further success.