[libxml-devel] [PATCH] libxml-ruby gem fails to build
Masashi Shimbo
shimbo at is.naist.jp
Sat Aug 19 11:14:28 EDT 2006
Hi,
I tried to install libxml-ruby 0.3.8 gem on my Ubuntu Linux box
without success. The installation apparently succeeded with no errors,
but 'gem check -t libxml-ruby' fails with the message
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require': no such file to load -- xml/libxml_so
(LoadError)
It seems that RubyGem expects the source directory for extensions to be
different from where they are installed (typically 'lib/'), but the
current libxml-ruby gem uses 'ext/' for both.
Consequently, the following happens with 'gem install';
Note that 'gem install' runs 'extconf.rb' in 'ext/xml/' and then
'make; make install; make clean':
1. The file 'ext/xml/libxml_so.so' compiles fine.
2. Because RUBYARCHDIR is 'ext/xml/', 'make install' does nothing.
# N.B. gem overwrites RUBYLIBDIR and RUBYARCHDIR to the value of
# 'require_path' field in the gem spec just before 'make' is run.
3. gem finally runs 'make clean' and 'ext/xml/libxml_so.so' is removed.
Attached is a patch that fixes the problem. It essentially
- creates 'lib/xml' directory;
- sets the gem spec 'require_path' field to 'lib/xml' (in place of
'ext/xml');
- moves 'ext/xml/libxml.rb' to 'lib/xml' directory; and
- installs libxml_so.so in 'lib/xml' upon 'gem install'.
My environment is: Ubuntu Linux 6.06 / RubyGem 0.9.0 / Ruby 1.8.4
Masashi Shimbo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libxml-ruby-0.3.8.diff
Type: application/octet-stream
Size: 5798 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/libxml-devel/attachments/20060820/581a5aae/attachment.obj
More information about the libxml-devel
mailing list