2016-11-28 16 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をインストールするにはどうすればいいですか?

問題は、宝石をインストールしようとすると、ネイティブ拡張が構築されないことです。私はいくつかのグーグルを行っているが、これまでの作品の問題への解決策を見つけていない

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 

:ここgem install libxml-ruby -v '2.3.2'を実行している時に、完全なエラーです。ここで私が試したことのいくつかがあります。

apple-gccのアンインストールがうまくいくかもしれないと示唆していましたが、それはネイティブ拡張をビルドするコンパイラなしで私に残っています。 と、OS Xに同梱されているlibxmlの最新バージョンとの間に互換性がありません。MacOSX10.8 SDKはXcodeに同梱されていないため、次の機能は動作しません。それとも、私はそこに何かを逃している?

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

この問題を解決するための手順はありますか?ご協力いただきありがとうございます!

答えて

0

実際には、互換性のないバージョンのruby gemとインストールされたlibxmlバージョンによって問題が発生していました。最終的には、それが正しくビルドされるように若干新しいバージョンのgemに更新することを選択します。

正確にバージョン2.3.2が必要な場合は、次のパッチを手動で適用することもできます。https://github.com/xml4r/libxml-ruby/commit/1c4878f3fdcd0cdf2e0fd09a5e6147a6ed237cf0

関連する問題