错误的解决方案nokogiri不会工作

时间:2014-08-21 03:04:43

标签: ruby-on-rails ruby nokogiri

当我尝试在rails项目上运行ruby时出现错误:

安装nokogiri(1.5.2)时发生错误,捆绑无法继续。 确保' gem install nokogiri -v 1.5.2在构建之前成功。

我已经尝试过此link

的解决方案
sudo yum install libxslt-dev libxml2-dev
Loaded plugins: fastestmirror, refresh-packagekit, replace, security
Loading mirror speeds from cached hostfile
 * epel: mirror.smartmedia.net.id
 * webtatic: nl.repo.webtatic.com
Setting up Install Process
No package libxslt-dev available.
No package libxml2-dev available.
Error: Nothing to do

错误日志gem install nokogiri -v' 1.5.0'

ERROR:  Error installing nokogiri:
    ERROR: Failed to build gem native extension.

        /usr/local/rvm/rubies/ruby-1.9.3-p429/bin/ruby 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_node.c
compiling xml_schema.c
compiling xml_sax_parser_context.c
compiling xml_entity_reference.c
compiling xml_document_fragment.c
compiling xml_reader.c
compiling xml_document.c
compiling html_element_description.c
In file included from /usr/local/rvm/rubies/ruby-1.9.3-p429/include/ruby-1.9.1/ruby.h:32:0,
                 from ./nokogiri.h:31,
                 from ./html_element_description.h:4,
                 from html_element_description.c:1:
html_element_description.c: In function ‘get_description’:
html_element_description.c:249:40: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
   return Data_Wrap_Struct(klass, 0, 0, (void *)description);
                                        ^
/usr/local/rvm/rubies/ruby-1.9.3-p429/include/ruby-1.9.1/ruby/ruby.h:818:35: note: in definition of macro ‘Data_Wrap_Struct’
     rb_data_object_alloc((klass),(sval),(RUBY_DATA_FUNC)(mark),(RUBY_DATA_FUNC)(free))
                                   ^
compiling xml_libxml2_hacks.c
compiling xml_namespace.c
xml_namespace.c: In function ‘prefix’:
xml_namespace.c:14:13: warning: variable ‘doc’ set but not used [-Wunused-but-set-variable]
   xmlDocPtr doc;
             ^
xml_namespace.c: In function ‘href’:
xml_namespace.c:33:13: warning: variable ‘doc’ set but not used [-Wunused-but-set-variable]
   xmlDocPtr doc;
             ^
compiling html_entity_lookup.c
compiling xml_element_decl.c
compiling xml_sax_push_parser.c
compiling xml_attribute_decl.c
compiling xml_sax_parser.c
compiling xml_xpath_context.c
compiling xml_dtd.c
compiling xml_syntax_error.c
compiling xml_relax_ng.c
compiling xml_text.c
compiling xml_comment.c
compiling xml_processing_instruction.c
compiling xml_attr.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]
   char *result = ruby_xmalloc((ssize_t) (len + 1));
                               ^
compiling xml_cdata.c
compiling html_document.c
compiling xml_io.c
xml_io.c: In function ‘io_read_callback’:
xml_io.c:28:3: warning: conversion to ‘int’ from ‘size_t’ may alter its value [-Wconversion]
   return safe_len;
   ^
compiling xml_element_content.c
compiling xml_entity_decl.c
compiling xml_node_set.c
compiling xslt_stylesheet.c
/tmp/ccw5ACWj.s: Assembler messages:
/tmp/ccw5ACWj.s:12: Error: expecting string instruction after `rep'
make: *** [xslt_stylesheet.o] Error 1

0 个答案:

没有答案