From: Peter Alta on
I am unable to find a libxml-ruby gem.
I've pasted some diagnostic info below.
Could someone please point me in the right direction?
Thank you.


C:\>irb
irb(main):001:0> require 'libxml-ruby'
LoadError: no such file to load -- libxml-ruby
from C:/Program
Files/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
from C:/Program
Files/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
from (irb):1
irb(main):002:0> exit

C:\>gem install -r libxml-ruby
ERROR: While executing gem ... (Gem::GemNotFoundException)
Could not find libxml-ruby (> 0) in any repository

C:\>gem sources
*** CURRENT SOURCES ***

http://gems.rubyforge.org
http://gems.github.com

C:\>gem -v
0.9.4

C:\>ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
--
Posted via http://www.ruby-forum.com/.

From: Peter Alta on
Phillip Gawlowski wrote:
>
> You can get a MinGW build of Ruby + devkit at RubyInstaller.org.
> RubyGems at RubyGems.org

Thank you. That was a helpful start. I updated to
RubyGems 1.3.5 and installed the MingGW build with
no apparent problem.

> You will need the devkit, and have to go header-file hunting.

What is "header-file hunting"?
I don't even know where to begin.
Is installing libxml-ruby beyond the scope
of a non-C programmer?

Here is what I get from gem now:

----------------------------------------------------------------------
C:\>gem install -r libxml-ruby
Building native extensions. This could take a while...
ERROR: Error installing libxml-ruby:
ERROR: Failed to build gem native extension.

checking for socket() in -lsocket... no
checking for gethostbyname() in -lnsl... no
checking for atan() in -lm... yes
checking for inflate() in -lz... no
checking for inflate() in -lzlib... no
checking for inflate() in -lzlib1... 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.
----------------------------------------------------------------------

I'm a little confused by "You may need configuration
options." Is that meant for the "gem" command? Or for
the extconf.rb that gem is apparently running?

Any hints on what to do next?

Thanks much.
--
Posted via http://www.ruby-forum.com/.

From: Phillip Gawlowski on
On 28.12.2009 23:31, Peter Alta wrote:

> What is "header-file hunting"?

Finding all the header-files the compiler (NOT the gem command, but the
compiler the devkit provides!) needs to be able to build a program or a
library.

> I don't even know where to begin.
> Is installing libxml-ruby beyond the scope
> of a non-C programmer?

On Windows? Probably. Very likely, in fact.

> Here is what I get from gem now:
>
> ----------------------------------------------------------------------
> C:\>gem install -r libxml-ruby
> Building native extensions. This could take a while...
> ERROR: Error installing libxml-ruby:
> ERROR: Failed to build gem native extension.
>
> checking for socket() in -lsocket... no
> checking for gethostbyname() in -lnsl... no
> checking for atan() in -lm... yes
> checking for inflate() in -lz... no
> checking for inflate() in -lzlib... no
> checking for inflate() in -lzlib1... 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.
> ----------------------------------------------------------------------
>
> I'm a little confused by "You may need configuration
> options." Is that meant for the "gem" command? Or for
> the extconf.rb that gem is apparently running?

Neither. It's for the C-Compiler.

> Any hints on what to do next?

Use Nokogiri (nokogiri.org). ;)

Or, if you must use libxml, set up a virtual machine with Linux, and use
that (which brings its own set of difficulties. virtualbox.org is a good
start to get going with virtualization).

The Devkit requires you to be either lucky, or to be at least
well-versed enough in working with compilers, to fix the issues the
configuration step throws at you. It's best if you are seasoned-enough
C-Programmer to dig into the actual C code to fix bugs, and produce a
build that can be distributed for Windows.

What you can do, is log a bug with the libxml-ruby team, and lobby them
to provide a MinGW32 compatible build.

--
Phillip Gawlowski

From: Tim Ferrell on
Phillip Gawlowski wrote:
> On 28.12.2009 23:31, Peter Alta wrote:
>
>> What is "header-file hunting"?
>
> Finding all the header-files the compiler (NOT the gem command, but the
> compiler the devkit provides!) needs to be able to build a program or a
> library.
>

I was able to get this gem to build on Windows (Win7 x64 to be precise)
by downloading the MinGW-based oneclick installer (RC1 as of now) and
the devkit that accompanies it and installing them... I then found the
necessary headers and libs needed to get the libxml-ruby gem to build
and packaged them up:

http://www.mcgeecorp.com/downloads/win-install-libxml-ruby.zip ~760kb

Just unzip and run the ruby install script to build...

Note: the script assumes you installed Ruby to C:\Ruby ... you can also
pass an alternate install dir to the script:

C:\Ruby19\bin\ruby install_libxml_gem.rb C:/Ruby19

HTH,
Tim
--
Posted via http://www.ruby-forum.com/.