[nokogiri-talk] Nokogiri can't find libxml2?

384 views
Skip to first unread message

Peregrinator

unread,
May 5, 2010, 3:38:39 PM5/5/10
to nokogiri-talk
I'm attempting to install the nokogiri gem on an Ubuntu 8.04LTS box
and running into the following problem. It can't seem to find libxml2
even though it is installed... Any thoughts?
Thanks
Bob

sudo gem install nokogiri -v=1.4.1 -- --with-xml2-include=/usr/lib/
libxml2 --with-xml2-lib=/usr/lib
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.

/usr/local/ruby-enterprise/bin/ruby extconf.rb --with-xml2-include=/
usr/lib/libxml2 --with-xml2-lib=/usr/lib
checking for iconv.h in /opt/local/include/,/usr/lib/libxml2,/opt/
local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/
include,/usr/local/include/libxml2,/usr/local/ruby-enterprise/include,/
usr/local/ruby-enterprise/include/libxml2,/usr/include,/usr/include/
libxml2... yes
checking for libxml/parser.h in /opt/local/include/,/usr/lib/libxml2,/
opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/
local/include,/usr/local/include/libxml2,/usr/local/ruby-enterprise/
include,/usr/local/ruby-enterprise/include/libxml2,/usr/include,/usr/
include/libxml2... no
libxml2 is missing. try 'port install libxml2' or 'yum install
libxml2-devel'
*** 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.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/ruby-enterprise/bin/ruby
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--with-xml2-dir
--without-xml2-dir
--with-xml2-include=${xml2-dir}/include
--with-xml2-lib=${xml2-dir}/lib
--with-xslt-dir
--without-xslt-dir
--with-xslt-include
--without-xslt-include=${xslt-dir}/include
--with-xslt-lib
--without-xslt-lib=${xslt-dir}/lib


Gem files will remain installed in /usr/local/ruby-enterprise/lib/ruby/
gems/1.8/gems/nokogiri-1.4.1 for inspection.
Results logged to /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/
nokogiri-1.4.1/ext/nokogiri/gem_make.out


AND also:

locate libxml
/opt/jruby-1.4.0/lib/ruby/gems/1.8/doc/activesupport-2.3.4/rdoc/files/
lib/active_support/xml_mini/libxml_rb.html
/opt/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/
active_support/xml_mini/libxml.rb
/usr/lib/libxml2.so.2
/usr/lib/libxml2.so.2.6.31
/usr/lib32/libxml2.so.2
/usr/lib32/libxml2.so.2.6.31
/usr/local/ruby-enterprise/lib/ruby/gems/1.8/doc/activesupport-2.3.3/
rdoc/files/lib/active_support/xml_mini/libxml_rb.html
/usr/local/ruby-enterprise/lib/ruby/gems/1.8/doc/activesupport-2.3.5/
rdoc/files/lib/active_support/xml_mini/libxml_rb.html
/usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/activesupport-2.3.2/
lib/active_support/xml_mini/libxml.rb
/usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/activesupport-2.3.3/
lib/active_support/xml_mini/libxml.rb
/usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/activesupport-2.3.4/
lib/active_support/xml_mini/libxml.rb
/usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/activesupport-2.3.5/
lib/active_support/xml_mini/libxml.rb
/usr/share/doc/libxml2
/usr/share/doc/libxml2-utils
/usr/share/doc/libxml2/AUTHORS
/usr/share/doc/libxml2/changelog.Debian.gz
/usr/share/doc/libxml2/changelog.gz
/usr/share/doc/libxml2/copyright
/usr/share/doc/libxml2/NEWS.gz
/usr/share/doc/libxml2/README
/usr/share/doc/libxml2/README.Debian
/usr/share/doc/libxml2/TODO.gz
/var/cache/apt/archives/libxml2-utils_2.6.31.dfsg-2ubuntu1.3_amd64.deb
/var/cache/apt/archives/libxml2-utils_2.6.31.dfsg-2ubuntu1.4_amd64.deb
/var/cache/apt/archives/libxml2_2.6.31.dfsg-2ubuntu1.3_amd64.deb
/var/cache/apt/archives/libxml2_2.6.31.dfsg-2ubuntu1.4_amd64.deb
/var/lib/dpkg/info/libxml2-utils.list
/var/lib/dpkg/info/libxml2-utils.md5sums
/var/lib/dpkg/info/libxml2.list
/var/lib/dpkg/info/libxml2.md5sums
/var/lib/dpkg/info/libxml2.postinst
/var/lib/dpkg/info/libxml2.postrm
/var/lib/dpkg/info/libxml2.shlibs
/var/lib/dpkg/info/libxml2.symbols

--
You received this message because you are subscribed to the Google Groups "nokogiri-talk" group.
To post to this group, send email to nokogi...@googlegroups.com.
To unsubscribe from this group, send email to nokogiri-tal...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nokogiri-talk?hl=en.

Aaron Patterson

unread,
May 5, 2010, 4:52:14 PM5/5/10
to nokogi...@googlegroups.com
Can you post the contents of mkmf.log somewhere that we can read?
That file should contain the precise error keeping it from detecting
libxml2.

--
Aaron Patterson
http://tenderlovemaking.com/

Peregrinator

unread,
May 5, 2010, 5:06:07 PM5/5/10
to nokogiri-talk
Here's the contents of mkmf.log - looks like it's related to libxml?
Thanks for the help!
-Bob

nokogiri_find_header: checking for iconv.h in /opt/local/include/,/opt/
local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/
include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/
local/ruby-enterprise/include,/usr/local/ruby-enterprise/include/
libxml2,/usr/include,/usr/include/libxml2... -------------------- yes

"gcc -E -I. -I/usr/local/ruby-enterprise/lib/ruby/1.8/x86_64-linux -I.
-I/opt/local/include/ -I/opt/local/include/libxml2 -I/opt/local/
include -g -O2 -g -DXP_UNIX -O3 -Wall -Wcast-qual -Wwrite-strings -
Wconversion -Wmissing-noreturn -Winline -I/usr/include conftest.c -o
conftest.i"
checked program was:
/* begin */
1: #include <iconv.h>
/* end */

--------------------

nokogiri_find_header: checking for libxml/parser.h in /opt/local/
include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/
include,/opt/local/include/libxml2,/usr/local/include,/usr/local/
include/libxml2,/usr/local/ruby-enterprise/include,/usr/local/ruby-
enterprise/include/libxml2,/usr/include,/usr/include/libxml2...
-------------------- no

"gcc -E -I/usr/include -I. -I/usr/local/ruby-enterprise/lib/ruby/1.8/
x86_64-linux -I. -I/opt/local/include/ -I/opt/local/include/libxml2 -I/
opt/local/include -g -O2 -g -DXP_UNIX -O3 -Wall -Wcast-qual -Wwrite-
strings -Wconversion -Wmissing-noreturn -Winline conftest.c -o
conftest.i"
conftest.c:1:27: error: libxml/parser.h: No such file or directory
checked program was:
/* begin */
1: #include <libxml/parser.h>
/* end */

--------------------





On May 5, 1:52 pm, Aaron Patterson <aaron.patter...@gmail.com> wrote:
> Aaron Pattersonhttp://tenderlovemaking.com/

Peregrinator

unread,
May 5, 2010, 7:49:21 PM5/5/10
to nokogiri-talk
Thanks for the help earlier Aaron - you pointed me in the right place
to look for the info I needed combined with the nokogiri gem failure
output.

I was missing the libxml2 and libxslt development packages.

The solution was to do:

sudo apt-get install libxml2-dev
sudo apt-get install libxslt1-dev

And then install nokogiri.

Mike Dalessio

unread,
May 6, 2010, 7:46:41 AM5/6/10
to nokogiri-talk
For future mailing-list-archive readers, installation instructions are
available at http://nokogiri.org/tutorials/installing_nokogiri.html
which include commands for Ubuntu.
Reply all
Reply to author
Forward
0 new messages