Can't install nokogiri 1.6.6.2 on debian wheezy

170 views
Skip to first unread message

Emmanuel Décarie

unread,
Oct 26, 2015, 9:37:00 AM10/26/15
to nokogiri-talk
Hello,

I can't find a way to install nokogiri 1.6.6.2 which is part of the CoRM package, an open source CRM (http://www.corm.fr/) on my Debian Wheezy server.

<pre>
Distributor ID: Debian
Description: Debian GNU/Linux 7.7 (wheezy)
Release: 7.7
Codename: wheezy

ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
</pre>

Here's part of the error message:

<pre>
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb --use-system-libraries
checking if the C compiler accepts ... yes
Building nokogiri using system libraries.
libxml2 version 2.6.21 or later is required!
*** 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.
</pre>

This is odd because it seems that I have every packages needed for libxml2:

<pre>
dpkg -l|grep libxml
ii  libxml-namespacesupport-perl       1.09-3                        all          Perl module for supporting simple generic namespaces
ii  libxml-parser-perl                 2.41-1+b1                     amd64        Perl module for parsing XML files
ii  libxml-sax-base-perl               1.07-1                        all          base class for SAX drivers and filters
ii  libxml-sax-expat-perl              0.40-2                        all          Perl module for a SAX2 driver for Expat (XML::Parser)
ii  libxml-sax-perl                    0.99+dfsg-2                   all          Perl module for using and building Perl SAX2 XML processors
ii  libxml2:amd64                      2.8.0+dfsg1-7+wheezy4         amd64        GNOME XML library
ii  libxml2-dev:amd64                  2.8.0+dfsg1-7+wheezy4         amd64        Development files for the GNOME XML library
ii  libxml2-utils                      2.8.0+dfsg1-7+wheezy2         amd64        XML utilities
ii  python-libxml2                     2.8.0+dfsg1-7+wheezy2         amd64        Python bindings for the GNOME XML library
ii  python-lxml                        2.3.2-1+deb7u1                amd64        pythonic binding for the libxml2 and libxslt libraries
ii  ruby-libxml                        2.3.2-1                       amd64        Ruby Bindings for LibXML2
</pre>

Also, I have already installed what's look like  an old version of the libnokogiri the and ruby-nokogiri lib installed.

<pre>
dpkg -l |grep nokogiri
ii  libnokogiri-ruby1.9.1              1.5.5-1                       all          Transitional package for ruby-nokogiri
ii  ruby-nokogiri                      1.5.5-1                       amd64        HTML, XML, SAX, and Reader parser for Ruby
</pre>

Here's the output of the mkmf.log:

<pre>
"gcc -o conftest -I/usr/include/ruby-1.9.1/x86_64-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -D_FORTIFY_SOURCE=2  -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -fno-strict-aliasing -fPIC  conftest.c  -L. -L/usr/lib -L. -Wl,-z,relro -rdynamic -Wl,-export-dynamic     -lruby-1.9.1  -lpthread -lrt -ldl -lcrypt -lm   -lc "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main() {return 0;}
/* end */

"gcc -I/usr/include/ruby-1.9.1/x86_64-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -D_FORTIFY_SOURCE=2  -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -fno-strict-aliasing -fPIC    -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main() {return 0;}
/* end */

package configuration for libxml-2.0 is not found
package configuration for libxslt is not found
package configuration for libexslt is not found
"gcc -E -I/usr/include/ruby-1.9.1/x86_64-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -D_FORTIFY_SOURCE=2  -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -fno-strict-aliasing -fPIC  -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline  conftest.c -o conftest.i"
conftest.c:3:31: fatal error: libxml/xmlversion.h: Aucun fichier ou dossier de ce type
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <libxml/xmlversion.h>
4: 
5: #if LIBXML_VERSION < 20621
6: #error libxml2 is way too old
7: #endif
/* end */
</pre>

It's like libxml2 is too old when it's newer than the requirement (as far as I can understand).

I'm not sure how to proceed from here.

Btw, I tried the tips provided on this page with no success:


TIA

-Emmanuel



Lars Kanis

unread,
Oct 26, 2015, 11:39:39 AM10/26/15
to nokogi...@googlegroups.com
The gem is installed with `--use-system-libraries` enabled, but the system libxml2 library is too old. You can however use the bundled libxml2 file, if you remove `--use-system-libraries` .

I did a quick test on debian 7.7:

``` sh
$ docker run -it --rm debian:7.7

root@ff2f4dccacab:/# cat /etc/os-release | grep NAME
PRETTY_NAME="Debian GNU/Linux 7 (wheezy)"
NAME="Debian GNU/Linux"

root@ff2f4dccacab:/# apt-get update && apt-get install ruby-dev zlib1g-dev patch make
[...]

root@ff2f4dccacab:/# gem inst nokogiri
Building native extensions.  This could take a while...
Successfully installed nokogiri-1.6.6.2
1 gem installed

root@ff2f4dccacab:/# irb -rnokogiri
irb(main):001:0> Nokogiri::VERSION
=> "1.6.6.2"
irb(main):002:0> Nokogiri::LIBXML_VERSION
=> "2.9.2"
```

--
Regards,
Lars

Emmanuel Décarie

unread,
Oct 31, 2015, 10:43:46 AM10/31/15
to nokogiri-talk
Hello Lars,

Thanks for your answer.

Although I didn't get from irb the right version, I was able to install the CoRM bundle.

Thanks!

$ apt-get install ruby-dev zlib1g-dev patch make
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances       
Lecture des informations d'état... Fait
make est déjà la plus récente version disponible.
patch est déjà la plus récente version disponible.
ruby-dev est déjà la plus récente version disponible.
zlib1g-dev est déjà la plus récente version disponible.
0 mis à jour, 0 nouvellement installés, 0 à enlever et 117 non mis à jour.

$ gem inst nokogiri
Building native extensions.  This could take a while...
Successfully installed nokogiri-1.6.6.2
1 gem installed
Installing ri documentation for nokogiri-1.6.6.2...
Installing RDoc documentation for nokogiri-1.6.6.2...

$ irb -rnokogiri
irb(main):001:0> Nokogiri::VERSION
=> "1.5.5" 
irb(main):002:0> Nokogiri::LIBXML_VERSION
=> "2.8.0" 


--
Regards,
Lars

Reply all
Reply to author
Forward
0 new messages