2016-11-28 62 views
0

我試圖安裝一個運行在Ruby 1.8.7-p370上的舊項目,並且在運行OS X El Capitan的Mac上依賴舊版本的libxml-ruby 2.3.2 gem。如何在OSX El Capitan上安裝libxml-ruby gem 2.3.2?

問題是,當試圖安裝gem時,它不會構建本機擴展。這是在運行gem install libxml-ruby -v '2.3.2'完整的錯誤:

Building native extensions. This could take a while... 
ERROR: Error installing libxml-ruby: 
    ERROR: Failed to build gem native extension. 

     /Users/myusername/.rbenv/versions/1.8.7-p370/bin/ruby extconf.rb 
checking for socket() in -lsocket... no 
checking for gethostbyname() in -lnsl... no 
checking for atan() in -lm... 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 
/usr/local/bin/gcc-4.2 -I. -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -fno-common -O3 -Wno-error=shorten-64-to-32 -pipe -fno-common -I/usr/include/libxml2 -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -c libxml.c 
couldn't understand kern.osversion `15.6.0' 
/usr/local/bin/gcc-4.2 -I. -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -fno-common -O3 -Wno-error=shorten-64-to-32 -pipe -fno-common -I/usr/include/libxml2 -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -c ruby_xml.c 
couldn't understand kern.osversion `15.6.0' 
/usr/local/bin/gcc-4.2 -I. -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -fno-common -O3 -Wno-error=shorten-64-to-32 -pipe -fno-common -I/usr/include/libxml2 -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -c ruby_xml_attr.c 
couldn't understand kern.osversion `15.6.0' 
/usr/local/bin/gcc-4.2 -I. -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -fno-common -O3 -Wno-error=shorten-64-to-32 -pipe -fno-common -I/usr/include/libxml2 -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -c ruby_xml_attr_decl.c 
couldn't understand kern.osversion `15.6.0' 
/usr/local/bin/gcc-4.2 -I. -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -fno-common -O3 -Wno-error=shorten-64-to-32 -pipe -fno-common -I/usr/include/libxml2 -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -c ruby_xml_attributes.c 
couldn't understand kern.osversion `15.6.0' 
/usr/local/bin/gcc-4.2 -I. -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -fno-common -O3 -Wno-error=shorten-64-to-32 -pipe -fno-common -I/usr/include/libxml2 -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -c ruby_xml_cbg.c 
couldn't understand kern.osversion `15.6.0' 
/usr/local/bin/gcc-4.2 -I. -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -fno-common -O3 -Wno-error=shorten-64-to-32 -pipe -fno-common -I/usr/include/libxml2 -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -c ruby_xml_document.c 
couldn't understand kern.osversion `15.6.0' 
ruby_xml_document.c: In function ‘rxml_document_canonicalize’: 
ruby_xml_document.c:334: warning: passing argument 4 of ‘xmlC14NDocDumpMemory’ from incompatible pointer type 
/usr/local/bin/gcc-4.2 -I. -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -fno-common -O3 -Wno-error=shorten-64-to-32 -pipe -fno-common -I/usr/include/libxml2 -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -c ruby_xml_dtd.c 
couldn't understand kern.osversion `15.6.0' 
/usr/local/bin/gcc-4.2 -I. -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -fno-common -O3 -Wno-error=shorten-64-to-32 -pipe -fno-common -I/usr/include/libxml2 -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -c ruby_xml_encoding.c 
couldn't understand kern.osversion `15.6.0' 
/usr/local/bin/gcc-4.2 -I. -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -fno-common -O3 -Wno-error=shorten-64-to-32 -pipe -fno-common -I/usr/include/libxml2 -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -c ruby_xml_error.c 
couldn't understand kern.osversion `15.6.0' 
/usr/local/bin/gcc-4.2 -I. -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -fno-common -O3 -Wno-error=shorten-64-to-32 -pipe -fno-common -I/usr/include/libxml2 -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -c ruby_xml_html_parser.c 
couldn't understand kern.osversion `15.6.0' 
/usr/local/bin/gcc-4.2 -I. -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -fno-common -O3 -Wno-error=shorten-64-to-32 -pipe -fno-common -I/usr/include/libxml2 -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -c ruby_xml_html_parser_context.c 
couldn't understand kern.osversion `15.6.0' 
/usr/local/bin/gcc-4.2 -I. -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -fno-common -O3 -Wno-error=shorten-64-to-32 -pipe -fno-common -I/usr/include/libxml2 -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -c ruby_xml_html_parser_options.c 
couldn't understand kern.osversion `15.6.0' 
/usr/local/bin/gcc-4.2 -I. -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -fno-common -O3 -Wno-error=shorten-64-to-32 -pipe -fno-common -I/usr/include/libxml2 -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -c ruby_xml_input_cbg.c 
couldn't understand kern.osversion `15.6.0' 
/usr/local/bin/gcc-4.2 -I. -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -fno-common -O3 -Wno-error=shorten-64-to-32 -pipe -fno-common -I/usr/include/libxml2 -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -c ruby_xml_io.c 
couldn't understand kern.osversion `15.6.0' 
/usr/local/bin/gcc-4.2 -I. -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -fno-common -O3 -Wno-error=shorten-64-to-32 -pipe -fno-common -I/usr/include/libxml2 -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -c ruby_xml_namespace.c 
couldn't understand kern.osversion `15.6.0' 
/usr/local/bin/gcc-4.2 -I. -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -fno-common -O3 -Wno-error=shorten-64-to-32 -pipe -fno-common -I/usr/include/libxml2 -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -c ruby_xml_namespaces.c 
couldn't understand kern.osversion `15.6.0' 
/usr/local/bin/gcc-4.2 -I. -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Users/myusername/.rbenv/versions/1.8.7-p370/include -fno-common -O3 -Wno-error=shorten-64-to-32 -pipe -fno-common -I/usr/include/libxml2 -I. -I/Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/1.8/i686-darwin15.6.0 -I. -I/usr/local/include -c ruby_xml_node.c 
couldn't understand kern.osversion `15.6.0' 
ruby_xml_node.c: In function ‘rxml_node_to_s’: 
ruby_xml_node.c:622: error: dereferencing pointer to incomplete type 
ruby_xml_node.c:624: error: dereferencing pointer to incomplete type 
make: *** [ruby_xml_node.o] Error 1 


Gem files will remain installed in /Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/gems/1.8/gems/libxml-ruby-2.3.2 for inspection. 
Results logged to /Users/myusername/.rbenv/versions/1.8.7-p370/lib/ruby/gems/1.8/gems/libxml-ruby-2.3.2/ext/libxml/gem_make.out 

我做了一些谷歌搜索,但到目前爲止還沒有找到一個解決方案,工程問題。以下是我嘗試過的一些事情。

一個建議是,卸載apple-gcc可能會工作,但這讓我沒有編譯器來構建本機擴展。

Another post suggested這與libxml-ruby 2.3.2和隨OS X附帶的更新版本的libxml之間的不兼容性有關。但是由於MacOSX10.8 SDK似乎不再適用於Xcode,因此以下方法無效。或者我錯過了什麼?

export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk 

我可以採取哪些措施來解決此問題?謝謝你的幫助!

回答