如標題所示,由於缺少libxml2或libxslt,因此似乎沒有失敗。我不確定是什麼使的錯誤。 (得到它?因爲問題是在製造?嘿嘿...)Nokogiri原生擴展失敗(不是libxml2或libxslt丟失問題)
Anywho,這是我得到的輸出。任何想法,將不勝感激:
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
extconf.rb:10: Use RbConfig instead of obsolete and deprecated Config.
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... yes
checking for xmlParseDoc() in -lxml2... yes
checking for xsltParseStylesheetDoc() in -lxslt... yes
checking for exsltFuncRegister() in -lexslt... yes
checking for xmlHasFeature()... yes
checking for xmlFirstElementChild()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetValidStructuredErrors()... yes
checking for xmlSchemaSetValidStructuredErrors()... yes
checking for xmlSchemaSetParserStructuredErrors()... yes
creating Makefile
make
compiling xml_element_content.c
compiling xml_relax_ng.c
compiling xml_cdata.c
compiling xml_sax_parser_context.c
compiling xml_node_set.c
compiling xml_text.c
compiling xml_sax_parser.c
compiling xml_attribute_decl.c
compiling nokogiri.c
nokogiri.c: In function ‘ruby_strdup’:
nokogiri.c:43:31: warning: conversion to ‘size_t’ from ‘long int’ may change the sign of the result [-Wsign-conversion]
compiling xml_entity_reference.c
compiling xml_node.c
compiling xml_xpath_context.c
xml_xpath_context.c: In function ‘xpath_generic_exception_handler’:
xml_xpath_context.c:184:3: error: format not a string literal and no format arguments [-Werror=format-security]
cc1: some warnings being treated as errors
make: *** [xml_xpath_context.o] Error 1
Gem files will remain installed in /var/lib/gems/1.9.1/gems/nokogiri-1.5.0 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/nokogiri-1.5.0/ext/nokogiri/gem_make.out
對於上下文,我從Ubuntu 12.04升級到12.10昨晚。我以前在這個盒子上建立了Nokogiri原生擴展,儘管我不知道它是否是相同的版本。
我也檢查了我在第二篇文章「error installing nokogiri 1.5.0 with rails 3.1.0 and ubuntu」 中指定的所有軟件包都無濟於事。
可能的問題是,你現在有一個更新的gcc,它有更嚴格的格式字符串檢查。您可以搜索xml_xpath_context.c並嘗試解決在l84報告的問題 - 這可能是將「printf」的用法替換爲「fputs」的簡單問題。 – slowdog