Skip to content

Instantly share code, notes, and snippets.

@nowlinuxing
Created May 8, 2014 02:51
Show Gist options
  • Select an option

  • Save nowlinuxing/07a84f44ac9296ab1656 to your computer and use it in GitHub Desktop.

Select an option

Save nowlinuxing/07a84f44ac9296ab1656 to your computer and use it in GitHub Desktop.
Install libxml-ruby-2.3.3 @ Marvericks
I try to install libxml-ruby-2.3.3 at MacOSX Marvericks via gem (rbenv, Ruby-2.1.0), get below errors:
Building native extensions. This could take a while...
ERROR: Error installing libxml-ruby:
ERROR: Failed to build gem native extension.
/Users/***/.rbenv/versions/2.1.0/bin/ruby extconf.rb
extconf.rb:17:in `<main>': Use RbConfig instead of obsolete and deprecated Config.
extconf.rb:17:in `<main>': Use RbConfig instead of obsolete and deprecated Config.
checking for socket() in -lsocket... no
checking for gethostbyname() in -lnsl... no
checking for atan() in -lm... yes
checking for inflate() in -lz... yes
checking for iconv_open() in -liconv... yes
checking for xmlParseDoc() in -lxml2... yes
checking for libxml/xmlversion.h... yes
creating extconf.h
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling libxml.c
compiling ruby_xml.c
ruby_xml.c:612:23: warning: assigning to 'const char *' from 'xmlChar *' (aka 'unsigned char *') converts between pointers to integer types with different sign [-Wpointer-sign]
xmlTreeIndentString = xmlStrdup((xmlChar *)StringValuePtr(string));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
compiling ruby_xml_attr.c
compiling ruby_xml_attr_decl.c
ruby_xml_attr_decl.c:57:53: warning: passing 'const xmlChar *' (aka 'const unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
return rxml_new_cstr((const char*) xattr->name, xattr->doc->encoding);
^~~~~~~~~~~~~~~~~~~~
./ruby_xml_encoding.h:11:51: note: passing argument to parameter 'xencoding' here
VALUE rxml_new_cstr(const char* xstr, const char* xencoding);
^
1 warning generated.
compiling ruby_xml_attributes.c
compiling ruby_xml_cbg.c
compiling ruby_xml_document.c
ruby_xml_document.c:331:5: warning: incompatible pointer types passing 'xmlChar *(*)[256]' to parameter of type 'xmlChar **' (aka 'unsigned char **') [-Wincompatible-pointer-types]
&inc_ns_prefixes_ptr,
^~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2/libxml/c14n.h:79:17: note: passing argument to parameter 'inclusive_ns_prefixes' here
xmlChar **inclusive_ns_prefixes,
^
ruby_xml_document.c:805:13: warning: assigning to 'const char *' from 'const xmlChar *' (aka 'const unsigned char *') converts between pointers to integer types with different sign [-Wpointer-sign]
xencoding = xdoc->encoding;
^ ~~~~~~~~~~~~~~
2 warnings generated.
compiling ruby_xml_dtd.c
compiling ruby_xml_encoding.c
compiling ruby_xml_error.c
compiling ruby_xml_html_parser.c
compiling ruby_xml_html_parser_context.c
compiling ruby_xml_html_parser_options.c
compiling ruby_xml_input_cbg.c
compiling ruby_xml_io.c
compiling ruby_xml_namespace.c
compiling ruby_xml_namespaces.c
compiling ruby_xml_node.c
ruby_xml_node.c:622:54: error: incomplete definition of type 'struct _xmlBuf'
result = rxml_new_cstr((const char*) output->conv->content, xencoding);
~~~~~~~~~~~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2/libxml/tree.h:104:16: note: forward declaration of 'struct _xmlBuf'
typedef struct _xmlBuf xmlBuf;
^
ruby_xml_node.c:624:56: error: incomplete definition of type 'struct _xmlBuf'
result = rxml_new_cstr((const char*) output->buffer->content, xencoding);
~~~~~~~~~~~~~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2/libxml/tree.h:104:16: note: forward declaration of 'struct _xmlBuf'
typedef struct _xmlBuf xmlBuf;
^
2 errors generated.
make: *** [ruby_xml_node.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/***/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/libxml-ruby-2.3.3 for inspection.
Results logged to /Users/***/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/libxml-ruby-2.3.3/gem_make.out
diff libxml-ruby-2.3.3.orig/ext/libxml/ruby_xml_document.c libxml-ruby-2.3.3/ext/libxml/ruby_xml_document.c
331c331
< &inc_ns_prefixes_ptr,
---
> inc_ns_prefixes_ptr,
diff libxml-ruby-2.3.3.orig/ext/libxml/ruby_xml_node.c libxml-ruby-2.3.3/ext/libxml/ruby_xml_node.c
620a621,626
> #ifdef LIBXML2_NEW_BUFFER
> if (output->conv)
> result = rxml_new_cstr((const char*) xmlBufContent(output->conv), xencoding);
> else
> result = rxml_new_cstr((const char*) xmlBufContent(output->buffer), xencoding);
> #else
624a631
> #endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment