0

When I try to run a ruby on rails project I got an error:

An error occurred while installing nokogiri (1.5.2), and bundle cannot continue. Make sure that 'gem install nokogiri -v 1.5.2 succeed before building.

I already try the solution from this 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

Error log 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
Community
  • 1
  • 1
agstwn21
  • 123
  • 1
  • 14
  • I did look into [Installing Nokogiri](http://nokogiri.org/tutorials/installing_nokogiri.html), where they have outlined clear instructions on installation, may be would help if you read it again, while re-creating the steps you took when this error occured – Robert Christopher Aug 21 '14 at 04:22
  • Could you run `gem install nokogiri -v '1.5.0'` and gives an error output after that? – zdk Aug 21 '14 at 04:59
  • I already try it, but i got this message `sudo port install libxml2 libxlst /var/tmp/sclngZEoj: line 8: port: command not found` also `yum install libxml2 libxlst Loaded plugins: fastestmirror, refresh-packagekit, replace, security Loading mirror speeds from cached hostfile * epel: mirrors.123host.vn * webtatic: nl.repo.webtatic.com Setting up Install Process Package libxml2-2.7.6-14.el6_5.2.x86_64 already installed and latest version No package libxlst available. Nothing to do` @RobertChristopher – agstwn21 Aug 21 '14 at 06:31

0 Answers0