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.

CentOS6.2サーバーにRVMを使用してruby1.9.3をインストールしました。実行しようとするgem install nokogiriと、以下の出力が生成されます。私はすでにnokogiriWebサイトにアクセスし、yumを使用してlibxml2とlibxsltの依存関係をインストールしました。

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

また、rubyを使用してlibxml2およびlibxsltパッケージをrvm pkg installインストールし、後で再インストールしました。

私は解決策を探していましたが、まだ何も見つかりませんでした。任意のアイデアをいただければ幸いです:)

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

リクエストに応じて、mkmf.logの内容は次のとおりです。

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 */
4

4 に答える 4

4

どういうわけか、これを修正しました。zlibを除くすべてのrvmパッケージ(libxml2、iconv、libxsltなど)を使用して削除し、 rvm pkg uninstall <package>1.9.3を使用して再インストールしました。rvm reinstall 1.9.3

それから私はやった、gem install nokogiriそしてそれはうまくいった...

なぜ今それが機能するのか完全には理解していません。おそらくlibxml2、iconv、libxslt rvmパッケージが悪いのでしょうか?

于 2012-07-06T19:10:34.547 に答える
3

その理由は、gemがnokogiri呼び出しpath/to/your/gems/ruby-1.9.3-p194/gems/nokogiri-1.5.5/ext/nokogiri/extconf.rbをインストールし、extconf.rbファイルに、

LIB_DIRS = [#最初に/ opt/localで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',   

ただし、libxml2 libは上記のパスにない場合があります。したがって、extconf.rbがlibxml2 libを検出できることを確認する必要があります。 私の解決策: 私のcentosは64ビットで、libxml2は/ usr / lib64にインストールされ、コピーusr/lib64/libxml2.so/usr/lib/libxml2.so て修正します。

于 2012-11-21T03:36:25.660 に答える
0

主要な問題は、Lion用にコンパイルされたrvm / brew / port /すべてのバイナリに古い/削除されたライブラリの依存関係があり、高レベルのソフトウェアのコンパイルと実行時の両方の問題が発生することです。すべてのbrewおよびport管理パッケージを削除し、すべての依存関係を再コンパイル/再インストールし、RVM管理ruby 1.9.3-p194を再コンパイルし、最後に「gem install nokogiri」が問題なく機能することで、システムでこれを修正しました。

古いコンパイル済みパッケージが機能することを納得させるために多くの時間を無駄にしました。代わりに、前述のものを再インストールするだけで(実際に再コンパイル/リンクしていることを確認してください)、問題はありません。

于 2012-07-23T23:56:34.187 に答える
0
sudo yum groupinstall "Development tools"

(CentOS 7.0.1406コアの場合)

于 2015-04-26T03:31:04.670 に答える