5

我尝试为 Mac OS X 安装 libxml-ruby v2.3.3。

localhost:tmp$ uname -a
Darwin 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:26:45 PDT 2012; root:xnu-1699.32.7~1/RELEASE_I386 i386

localhost:tmp$ ruby -v
ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-darwin11.4.2]

localhost:tmp$ gem -v
1.8.24

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

    /Users/ruslan/.rvm/rubies/ruby-1.9.2-p320/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

...
/usr/bin/gcc-4.2 -I. -I/Users/ruslan/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1/x86_64-darwin11.4.2 -I/Users/ruslan/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1/ruby/backward -I/Users/ruslan/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1 -I. -I/usr/local/include -DRUBY_EXTCONF_H=\"extconf.h\" -I/Users/ruslan/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long  -fno-common -pipe -I/opt/local/include/libxml2 -I/Users/ruslan/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1/x86_64-darwin11.4.2 -I/Users/ruslan/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1/ruby/backward -I/Users/ruslan/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1 -I. -I/usr/local/include  -o ruby_xml_node.o -c ruby_xml_node.c
ruby_xml_node.c: In function ‘rxml_node_new_cdata’:
ruby_xml_node.c:151: warning: implicit conversion shortens 64-bit value into a 32-bit value
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

libxml-ruby v2.7.0 已成功安装。但在我的项目中必然需要 libxml-ruby 2.3.3 版。

请帮忙。谢谢你。

4

0 回答 0