# How can I install ruby-xslt?

**URL:** <https://www.ruby-forum.com/t/how-can-i-install-ruby-xslt/100532>\
**Category:** Ruby\
**Created:** [December 2, 2005, 12:21pm UTC](https://www.ruby-forum.com/t/how-can-i-install-ruby-xslt/100532 "2005-12-02T12:21:14Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 2, 2005, 12:21pm UTC](https://www.ruby-forum.com/t/how-can-i-install-ruby-xslt/100532/1 "2005-12-02T12:21:14Z")

</div>

Hello,

I can’t figure how I to install ruby-xslt (downloaded from this page:  
[http://www.rubyfr.net/](http://www.rubyfr.net/)).

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  
extconf.rb.  
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:

Code:

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.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 2, 2005, 8:44pm UTC](https://www.ruby-forum.com/t/how-can-i-install-ruby-xslt/100532/2 "2005-12-02T20:44:37Z")

</div>

Please, could someone help me ?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 2, 2005, 9:25pm UTC](https://www.ruby-forum.com/t/how-can-i-install-ruby-xslt/100532/3 "2005-12-02T21:25:36Z")

</div>

Have you been to:

[http://rubyforge.org/search/?type\_of\_search=soft&words=xslt&Search=Search](http://rubyforge.org/search/?type_of_search=soft&words=xslt&Search=Search)

It appears the easiest way is to just do a

> gem install xml-tools

AE  
[http://frugalprogrammer.com](http://frugalprogrammer.com)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 2, 2005, 10:10pm UTC](https://www.ruby-forum.com/t/how-can-i-install-ruby-xslt/100532/4 "2005-12-02T22:10:22Z")

</div>

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

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  
here).

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.

AE  
[http://frugalprogrammer.com](http://frugalprogrammer.com)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 2, 2005, 9:45pm UTC](https://www.ruby-forum.com/t/how-can-i-install-ruby-xslt/100532/5 "2005-12-02T21:45:50Z")

</div>

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  
libxslt  
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:

C:\programmes\ruby\libxml-ruby\extconf.rb

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

> **[Pixarea](https://blog.pixarea.com/)**
>
> A blog about programming for the web, and various interesting things.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 2, 2005, 10:26pm UTC](https://www.ruby-forum.com/t/how-can-i-install-ruby-xslt/100532/6 "2005-12-02T22:26:38Z")

</div>

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

T.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 2, 2005, 10:26pm UTC](https://www.ruby-forum.com/t/how-can-i-install-ruby-xslt/100532/7 "2005-12-02T22:26:38Z")

</div>

> 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?

T.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 2, 2005, 10:30pm UTC](https://www.ruby-forum.com/t/how-can-i-install-ruby-xslt/100532/8 "2005-12-02T22:30:42Z")

</div>

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)  
if CFLAGS.index(CONFIG[‘CCDLFLAGS’])  
$CFLAGS = CFLAGS  
else  
$CFLAGS = CFLAGS + ’ ’ + CONFIG[‘CCDLFLAGS’]  
end  
else  
$CFLAGS = CONFIG[‘CFLAGS’]  
end  
$LDFLAGS = CONFIG[‘LDFLAGS’]  
$LIBPATH.push(Config::CONFIG[‘libdir’])

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

dir\_config(‘iconv’)  
dir\_config(‘xml2’)  
dir\_config(‘zlib’)

have\_library(‘socket’,‘socket’)  
have\_library(‘nsl’,‘gethostbyname’)

unless have\_library(‘m’, ‘atan’)  
crash(‘need libm’)  
end

unless have\_library(‘z’, ‘inflate’)  
crash(‘need zlib’)  
else  
$defs.push(’-DHAVE\_ZLIB\_H’)  
end

unless have\_library(‘iconv’,‘iconv\_open’) or  
have\_library(‘c’,‘iconv\_open’) or  
have\_library(‘recode’,‘iconv\_open’)  
crash(\<\<EOL)  
need libiconv.

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

--with-iconv-dir=/path/to/iconv
--with-iconv-lib=/path/to/iconv/lib
--with-iconv-include=/path/to/iconv/include

```

EOL  
end

unless have\_library(‘xml2’, ‘xmlParseDoc’)  
crash(\<\<EOL)  
need libxml2.

```
    Install the library or try one of the following options to

```

extconf.rb:

```
    --with-xml2-dir=/path/to/libxml2
    --with-xml2-lib=/path/to/libxml2/lib
    --with-xml2-include=/path/to/libxml2/include

```

EOL  
end

unless have\_library(‘xml2’, ‘xmlDocFormatDump’)  
crash(‘Your version of libxml2 is too old. Please upgrade.’)  
end

unless have\_func(‘docbCreateFileParserCtxt’)  
crash(‘Need docbCreateFileParserCtxt’)  
end

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

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

create\_header()  
create\_makefile(‘xml/libxml’)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 2, 2005, 11:11pm UTC](https://www.ruby-forum.com/t/how-can-i-install-ruby-xslt/100532/9 "2005-12-02T23:11:33Z")

</div>

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

> **[Pixarea](https://blog.pixarea.com/)**
>
> A blog about programming for the web, and various interesting things.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 2, 2005, 11:52pm UTC](https://www.ruby-forum.com/t/how-can-i-install-ruby-xslt/100532/10 "2005-12-02T23:52:02Z")

</div>

You may check here [GnuWin32 Installation and Usage](http://gnuwin32.sourceforge.net/install.html). You  
will need the gnu win32 compiler(s), however much a contradiction in  
terms that may be  
([GnuWin - Browse Files at SourceForge.net](http://sourceforge.net/project/showfiles.php?group_id=23617&release_id=66784)).

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.

AE  
[http://frugalprogrammer.com](http://frugalprogrammer.com)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 3, 2005, 12:44am UTC](https://www.ruby-forum.com/t/how-can-i-install-ruby-xslt/100532/11 "2005-12-03T00:44:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 2, 2005, 10:47pm UTC](https://www.ruby-forum.com/t/how-can-i-install-ruby-xslt/100532/12 "2005-12-02T22:47:02Z")

</div>

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 [http://www.pixarea.com](http://www.pixarea.com)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 3, 2005, 10:18pm UTC](https://www.ruby-forum.com/t/how-can-i-install-ruby-xslt/100532/13 "2005-12-03T22:18:57Z")

</div>

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.
