2012-07-06 22 views
5
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': 
The compiler failed to generate an executable file. (RuntimeError) 
You have to install development tools first. 

He instalado ruby ​​1.9.3 usando RVM en mi servidor CentOS 6.2. Cuando intento ejecutar gem install nokogiri, produce el resultado a continuación. Ya he visitado el sitio web nokogiri e instalado las dependencias libxml2 y libxslt usando yum:Problemas para instalar nokogiri con RVM 1.9.3 en Centos 6.2

sudo yum install -y gcc ruby-devel libxml2 libxml2-devel libxslt libxslt-devel 

También he instalado los paquetes de libxml2 y libxslt utilizando rvm pkg install y reinstalado rubí después.

He estado buscando una solución, pero todavía no he encontrado nada. Cualquier idea sería apreciada :)

Building native extensions. This could take a while... 
ERROR: Error installing nokogiri: 
     ERROR: Failed to build gem native extension. 

     /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb 
checking for libxml/parser.h... *** 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 
     --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/rvm/rubies/ruby-1.9.3-p194/bin/ruby 
     --with-zlib-dir 
     --without-zlib-dir 
     --with-zlib-include 
     --without-zlib-include=${zlib-dir}/include 
     --with-zlib-lib 
     --without-zlib-lib=${zlib-dir}/lib 
     --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 
     --without-xml2-include=${xml2-dir}/include 
     --with-xml2-lib 
     --without-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 
     --with-libxslt-config 
     --without-libxslt-config 
     --with-pkg-config 
     --without-pkg-config 
     --with-libxml-2.0-config 
     --without-libxml-2.0-config 
     --with-libiconv-config 
     --without-libiconv-config 
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError) 
You have to install development tools first. 
     from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp' 
     from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:970:in `block in find_header' 
     from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for' 
     from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone' 
     from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
     from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone' 
     from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
     from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:280:in `postpone' 
     from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for' 
     from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:969:in `find_header' 
     from extconf.rb:114:in `<main>' 


Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p194/gems/nokogiri-1.5.5 for inspection. 
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p194/gems/nokogiri-1.5.5/ext/nokogiri/gem_make.out 

Éstos son los contenidos de mkmf.log conforme a lo solicitado:

package configuration for libxslt 
cflags: -I/usr/include/libxml2 
ldflags: 
libs: -lxslt -lz -lm -lxml2 

package configuration for libxml-2.0 
cflags: -I/usr/include/libxml2 
ldflags: 
libs: -lxml2 

package configuration for libiconv is not found 
"gcc -o conftest -I/usr/local/rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/x86_64-linux -I/usr/local/rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/backward -I/usr/local/rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1 -I. -I/opt/local/include/libxml2 -I/usr/local/include/libxml2 -I/usr/local/rvm/rubies/ruby-1.9.3-p194/include/libxml2 -I/opt/local/include -I/usr/local/include -I/usr/local/rvm/rubies/ruby-1.9.3-p194/include -I/usr/include -I/usr/include/libxml2 -I/usr/local/rvm/usr/include  -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC -g -DXP_UNIX -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -I/usr/include/libxml2 -I/usr/include/libxml2 conftest.c -L. -L/usr/local/rvm/rubies/ruby-1.9.3-p194/lib -Wl,-R/usr/local/rvm/rubies/ruby-1.9.3-p194/lib -L/opt/local/lib -Wl,-R/opt/local/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/local/rvm/rubies/ruby-1.9.3-p194/lib -Wl,-R/usr/local/rvm/rubies/ruby-1.9.3-p194/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/local/rvm/usr/lib -Wl,-R/usr/local/rvm/usr/lib -L. -rdynamic -Wl,-export-dynamic  -lxslt -lz -lm -lxml2 -lxml2 -Wl,-R -Wl,/usr/local/rvm/rubies/ruby-1.9.3-p194/lib -L/usr/local/rvm/rubies/ruby-1.9.3-p194/lib -lruby -lpthread -lrt -ldl -lcrypt -lm -lc " 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.0' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.5' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.25' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.0' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.5' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.0' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.0' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]LIBXML2_2.6.0' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.5.4' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.5.4' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.17' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.0' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.15' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.0' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.17' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.5.6' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.0' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.0' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.0' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.3' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.0' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.0' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.27' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.0' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]XML2_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.17' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.6.0' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `[email protected]_2.4.30' 
collect2: ld returned 1 exit status 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: int main() {return 0;} 
/* end */ 
+0

¿Se puede pegar el contenido de mkmg.log – Hashken

+0

es necesario proporcionar el contenido de su archivo mkmf.log para que cualquiera pueda dar consejos. –

Respuesta

4

i fijo esto, de alguna manera. He quitado todos los paquetes de RVM (libxml2, iconv, libxslt, etc.) excepto por el uso de zlib rvm pkg uninstall <package> que vuelva a instalar 1.9.3 usando rvm reinstall 1.9.3

luego hice un gem install nokogiri y funcionó muy bien ...

No entiendo completamente por qué funciona ahora, quizás los paquetes libxml2, iconv, libxslt rvm son malos?

+0

Hice algunos cambios en mi entorno relacionados con esas bibliotecas y debido a que mi instalación de Ruby estaba rota. Después de reinstalarlo, nokogiri instalado muy bien, gracias. –

+0

¿hay alguna manera de desinstalar todos los paquetes rvm excluyendo zlib de una vez?gracias – Ravin

0

El problema principal parece ser que sus binarios rvm/brew/port/whatever compilados para Lion van a tener algunas dependencias de biblioteca obsoletas/eliminadas, causando problemas de compilación y de tiempo de ejecución para el software de nivel superior. Arreglé esto en mi sistema atacando todos mis brew y paquetes gestionados por puerto, recompilando/reinstalando todas mis dependencias, recompilando mi RVM-managed ruby ​​1.9.3-p194, y finalmente `gem install nokogiri 'funcionó sin problemas.

Perdí un montón de tiempo tratando de convencer a mis obsoletos paquetes compilados de trabajo. En su lugar, simplemente reinstale lo mencionado anteriormente (asegurándose de que realmente está recompilando/vinculando) y debería estar bien.

+0

¿Quiere decir reinstalar ruby ​​1.9.3-p194? He intentado hacer esto a través de rvm, pero ¿no ha resuelto el problema? ¿Podría ser porque no recompila/vincula y, de ser así, cómo me aseguro de que recompila/vincula? – Ravin

+0

También debe desinstalar cualquier paquete de dependencia que pueda haber instalado con RVM (libxml2, libiconv, etc.) –

3

La razón es que la gema instalar nokogiri llamar path/to/your/gems/ruby-1.9.3-p194/gems/nokogiri-1.5.5/ext/nokogiri/extconf.rb, y en extconf.rb archivo,

LIB_DIRS = [ # Primera búsqueda/opt/local para macports '/ opt/local/lib',

# Then search /usr/local for people that installed from source 
'/usr/local/lib', 

# Check the ruby install locations 
LIBDIR, 

# Finally fall back to /usr 
'/usr/lib', 

pero su lib libxml2 no puede ser al anterior paths.so debe asegurarse extconf.rb puede encontrar su libxml2 lib Mi solución: Mi centos es de 64 bits, libxml2 está instalado en/usr/lib64, y copio usr/lib64/libxml2.so en /usr/lib/libxml2.so para solucionarlo.

0
sudo yum groupinstall "Development tools" 

(en CentOS 7.0.1406 Core)