gpt4 book ai didi

ruby - Nokogiri native 扩展无法构建(不是 libxml2 或 libxslt 缺失问题)

转载 作者:数据小太阳 更新时间:2023-10-29 07:40:55 28 4
gpt4 key购买 nike

正如标题所说,它似乎并没有因为缺少 libxml2 或 libxslt 而失败。我不太确定该错误是什么造成的。 (明白了吗?因为问题出在make的时候?呵呵...)

任何人,这是我得到的输出。任何想法将不胜感激:

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”上的第二篇文章中指定的所有包 无济于事。

最佳答案

我花了一些时间来弄清楚如何附加 cflags。这是我对 nokogiri 1.4.7 的命令:

sudo gem install  nokogiri -v '1.4.7' -- --with-cflags=\"-Wformat-nonliteral -Wno-format-security\"

关于ruby - Nokogiri native 扩展无法构建(不是 libxml2 或 libxslt 缺失问题),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13969716/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com