libxml-ruby and Windows
Posted by Pieter Bos Tue, 09 Oct 2007 12:41:25 GMT
So, my first post on movesonrails.com! You might not know me, but I am one of the Nedap Healthcare developers. Usually I don't work on Moves or even with ruby on rails, but I needed some functionality...
You might have seen a patch by Bart that allowed ActiveResource to be used with Libxml-ruby, with a dramatic performance increase. The downside was, you can't use libxml with Windows, limiting your applications to mac-os and linux. There was one build of libxml-ruby, which didn't really work, is an older version and missed some rather important files.
But now you can use libxml-ruby in windows! Just unpack this zip into your ruby directory, rename ruby\lib\ruby\site_ruby\1.8\i386-msvcrt\xmlparser.so to xmlparser.s_ and you'll have libxml 0.5.2.0 !
If you'd rather had libxml-ruby 0.3.8.4, you can download this zip instead, or even 0.5.1.0
To achieve this, I spent a morning compiling libxml with mingw. Just forget the following if you just want to use this, but for the sake of future version, this is what i had to do:
1 . install mingw and MSYS in the standard directories (c:\mingw)
2 . download the ruby source and compile, in a different directory than c:\ruby:
./configure --with-prefix=c:/mingw/ruby make make install
3 . download the zlib, iconv and libxml sources
4 . compile all of them with :
./configure --with-prefix=c:/mingw make make install
5 . download libxml-ruby
6 . now, the tricky part. You won't have rake (you didn't compile it) so we have to do a trick. Go to your libxml-ruby source directory and type:
/c/mingw/ruby/bin/ruby ext/xml/extconf.rb make make install
7 . everything has been compiled. Just copy these files:
to ruby\bin: c:\mingw\bin\iconv-2.dll c:\mingw\bin\libxml2-2.dllto ruby\lib\ruby\site_ruby\1.8\i386-msvcrt\xml: C:\MinGW\ruby\lib\ruby\site_ruby\1.8\i386-msvcrt\xml\libxml_so.oto ruby\lib\ruby\site_ruby\1.8\xml C:\MinGW\ruby\lib\ruby\site_ruby\1.8\xml\libxml.rb
have fun with a 20 times faster XML parser :)

Go pieter! :P Welcome, may you generate much traffic :P
How many Engineers does it take to compile ruby-libxml under Windows?
You are the man. Thanks!
You'll always see, just after creating this, they released libxml-ruby 0.5.2 :P.
Of course, there will be a new version on here for 0.5.2.0 soon, as well as for the latest stable release :)
Amazing..thank you thank you thank you!
Can I find the pre-compiled binaries anywhere? I would like to get a certain ruby webapp to run on my laptop, but not bad enough that I am ready to spend many hours installing, compiling and hacking. If some kind soul was kind enough to want to email those DLLs to me, my email address is: passani at eunet dot no thank you Luca
my bad. I did not see that the pre-compiled packages were available Luca
No problem :).
Thank you!!!
thanks a lot. Please work me out for libxslt too.