Trouble installing nokogiri with RVM 1.9.3 on Centos 6.2
Asked Answered
M

4

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.

I have installed ruby 1.9.3 using RVM on my CentOS 6.2 server. When I try to run gem install nokogiri it produces the the output below. I have already visited the nokogiri website and installed the libxml2 and libxslt dependencies using yum:

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

I have also installed the libxml2 and libxslt packages using rvm pkg install and reinstalled ruby afterward.

I have been searching for a solution, but I haven't found anything yet. Any ideas would be appreciated :)

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

Here are the contents of mkmf.log as requested:

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 `xmlGetLineNo@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlIsExtenderGroup@LIBXML2_2.6.0'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathFreeContext@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlMalloc@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathIsNodeType@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlStrchr@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlFreeDtd@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathCtxtCompile@LIBXML2_2.6.5'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlSplitQName2@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlHashUpdateEntry@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathEvalPredicate@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlRealloc@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathContextSetCache@LIBXML2_2.6.25'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlFreeURI@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlAddPrevSibling@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlFindCharEncodingHandler@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlHashFree@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlSetProp@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `valuePop@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathIsNaN@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlFreeIDTable@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlHashRemoveEntry2@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPtrEval@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathNextAncestor@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathInit@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlHashScan@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlOutputBufferCreateFd@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathCompiledEval@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlHashAddEntry3@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathFreeParserContext@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathErr@LIBXML2_2.6.0'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlDictCreateSub@LIBXML2_2.6.5'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlDocSetRootElement@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathObjectCopy@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlDictReference@LIBXML2_2.6.0'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPtrNewContext@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNewText@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNewComment@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlOutputBufferClose@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlBufferCat@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNodeDumpOutput@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlHashLookup3@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlHasNsProp@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlIsDigitGroup@LIBXML2_2.6.0'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `htmlDocContentDumpOutput@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathRegisterFunc@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlStrPrintf@LIBXML2_2.6.0'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlStrndup@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlSearchNs@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNewDocNode@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlValidateQName@LIBXML2_2.5.4'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlMutexLock@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathNodeSetAddUnique@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlValidateNCName@LIBXML2_2.5.4'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNodeAddContent@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlGetID@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathRegisterFuncLookup@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlFreeRefTable@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlStrdup@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlModuleSymbol@LIBXML2_2.6.17'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlHashUpdateEntry2@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlBufferFree@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNewDocText@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlUnlinkNode@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNewChild@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNodeGetBase@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathNodeSetMerge@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlMutexUnlock@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlFreeNode@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlStrstr@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlDictLookup@LIBXML2_2.6.0'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlGenericError@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlBufferWriteQuotedString@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNewDocPI@LIBXML2_2.6.15'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlDocGetRootElement@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathNumberFunction@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlIsBaseCharGroup@LIBXML2_2.6.0'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathNewContext@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathWrapNodeSet@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNodeSetContent@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlGetIntSubset@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlParseURI@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlGetDtdAttrDesc@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlBufferAdd@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlParseDocument@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathFreeNodeSet@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlHashCreate@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathCastToString@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlCheckFilename@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `htmlDocContentDumpFormatOutput@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNewMutex@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlLoadExternalEntity@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlModuleOpen@LIBXML2_2.6.17'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathCompile@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `htmlNewDoc@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathStringFunction@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlDocCopyNode@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlAddID@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNewNs@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNewParserCtxt@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathConvertString@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNewNsProp@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlGetDocEntity@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNodeGetSpacePreserve@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathOrderDocElems@LIBXML2_2.5.6'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathNewParserContext@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlDictCreate@LIBXML2_2.6.0'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlFree@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathRegisterFuncNS@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathDebugDumpObject@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlDictQLookup@LIBXML2_2.6.0'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlGenericErrorContext@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathEvalExpression@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `htmlNewDocNoDtD@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlHashLookup2@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlOutputBufferWriteString@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlOutputBufferCreateFilename@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlStrncat@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlStrlen@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlCharInRange@LIBXML2_2.6.0'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNewDoc@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlAddChild@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlGetCharEncodingName@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathRegisterVariableLookup@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathFreeCompExpr@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathNewCString@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlStrncasecmp@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXIncludeProcessFlags@LIBXML2_2.6.3'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlIsCombiningGroup@LIBXML2_2.6.0'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathNodeSetCreate@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlHashScanFull@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `inputPush@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlStrEqual@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `valuePush@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlGetNsList@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlIsBlankNode@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlURIEscapeStr@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathCmpNodes@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlCreateURI@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathNextPrecedingSibling@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathIsInf@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlDictFree@LIBXML2_2.6.0'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlBufferCCat@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathCompiledEvalToBoolean@LIBXML2_2.6.27'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlOutputBufferCreateFile@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlSaveUri@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNewDocProp@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlFreeParserCtxt@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlFreeMutex@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNewDocNodeEatName@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathNodeSetAdd@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlStringTextNoenc@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlSearchNsByHref@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathStringEvalNumber@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNewCDataBlock@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathNewValueTree@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlBufferCreate@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlHashAddEntry2@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlFreeNodeList@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathNewString@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlStringText@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathEval@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlOutputBufferFlush@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlBufferContent@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathNsLookup@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlGetProp@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlParserGetDirectory@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlUTF8Strloc@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlHashRemoveEntry@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathFreeObject@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathNewBoolean@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlUTF8Strpos@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlStrncmp@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlIsID@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathFunctionLookupNS@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlCtxtUseOptions@LIBXML2_2.6.0'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlGetNsProp@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathCastNodeToString@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNewTextLen@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNodeListGetString@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlHashAddEntry@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlAllocOutputBuffer@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlModuleClose@LIBXML2_2.6.17'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlSetNsProp@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathConvertNumber@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlStrcasecmp@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlNodeGetContent@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlStrcmp@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlCreateIntSubset@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlFreeDoc@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlCopyCharMultiByte@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlHashUpdateEntry3@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlDictOwns@LIBXML2_2.6.0'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlStrcat@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlStringCurrentChar@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlXPathNewNodeSet@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `htmlSetMetaEncoding@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlHashLookup@LIBXML2_2.4.30'
/usr/local/rvm/usr/lib/libxslt.so: undefined reference to `xmlBuildURI@LIBXML2_2.4.30'
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */
Massy answered 6/7, 2012 at 0:43 Comment(2)
Can you paste the contents of mkmg.logHartzke
You need to provide the contents of your mkmf.log file in order for anyone to give you advice.Intellectualize
M
4

I fixed this, somehow. I removed all of the rvm packages (libxml2, iconv, libxslt, etc.) except for zlib using rvm pkg uninstall <package> I then re-installed 1.9.3 using rvm reinstall 1.9.3

Then I did a gem install nokogiri and it worked just fine...

I don't completely understand why it works now, perhaps the libxml2, iconv, libxslt rvm packages are bad?

Massy answered 6/7, 2012 at 19:10 Comment(2)
I did some changes in my environment related to those libraries and due that my Ruby install was broken. After reinstalling it, nokogiri installed just fine, thanks.Fajardo
is there any way of uninstalling all the rvm packages excluding zlib in one go? thanksWist
Q
3

The reason is that gem install nokogiri call path/to/your/gems/ruby-1.9.3-p194/gems/nokogiri-1.5.5/ext/nokogiri/extconf.rb,and in extconf.rb file,

LIB_DIRS = [ # First search /opt/local for 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',   

but your libxml2 lib may not at above paths.so you must make sure extconf.rb can find your libxml2 lib My solution: My centos is 64bit,libxml2 is installed at /usr/lib64,and I copy usr/lib64/libxml2.so to /usr/lib/libxml2.so to fix it.

Querida answered 21/11, 2012 at 3:36 Comment(0)
O
0

The core issue seems to be that your rvm/brew/port/whatever binaries compiled for Lion are going to have some outdated/removed library dependencies, causing both compilation and runtime issues for higher-level software. I fixed this on my system by nuking all my brew and port-managed packages, recompiling/reinstalling all my dependencies, recompiling my RVM-managed ruby 1.9.3-p194, and finally `gem install nokogiri' worked without issues.

I wasted a lot of time trying to convince my outdated compiled packages work. Instead, just reinstall the aforementioned (making sure you're actually recompiling/linking) and you should be fine.

Olives answered 6/7, 2012 at 0:43 Comment(2)
Do you mean reinstall ruby 1.9.3-p194? I've tried doing this through rvm but is hasn't solved the problem? Might this be because its not recompiling/linking and if so how do I make sure it is recompiling/linking?Wist
You also have to uninstall any dependency packages that you may have installed with RVM as well (libxml2, libiconv, etc)Massy
S
0
sudo yum groupinstall "Development tools"

(on CentOS 7.0.1406 Core)

Stypsis answered 26/4, 2015 at 3:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.