加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – OS X Mavericks,无法安装libxml-ruby gem?

发布时间:2020-12-17 02:39:36 所属栏目:百科 来源:网络整理
导读:在干净安装的Mac OS 10.9上,从10.7.5开始,我似乎无法安装libxml- ruby gem.我使用Homebrew和RVM来管理我的环境,并且我安装了以下内容: brew listapple-gcc42 gcc46 libmpc08 mpfr2 postgresqlautoconf gmp4 libtool mysql55 ppl011automake libgpg-error li
在干净安装的Mac OS 10.9上,从10.7.5开始,我似乎无法安装libxml- ruby gem.我使用Homebrew和RVM来管理我的环境,并且我安装了以下内容:

brew list

apple-gcc42 gcc46       libmpc08    mpfr2       postgresql
autoconf    gmp4        libtool     mysql55     ppl011
automake    libgpg-error    libxml2     openssl     readline
cloog-ppl015    libiconv    libxslt     ossp-uuid   wget
cmake       libksba     libyaml     pkg-config

进入brew医生退货:

Your system is ready to brew.

运行捆绑安装会产生以下内容,我已删除链接.如果没有10个声誉我显然不能发布超过两个:

Fetching source index from . . .
Fetching source index from . . .
Fetching source index from . . .
Resolving dependencies..............................................................................................
Using rake (10.0.4) 
Using Platform (0.4.0) 
Using open4 (1.3.0) 
Using POpen4 (0.1.4)

等,最终到达:

Using nokogiri (1.5.9)

等等

Installing libxml-ruby (2.3.3) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/iandonovan/.rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb --with-opt-include=/usr/local/Cellar/libxml2/2.9.1/include/
extconf.rb:17: 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... 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
compiling libxml.c
compiling ruby_xml.c
ruby_xml.c: In function 'rxml_default_tree_indent_string_set':
ruby_xml.c:612:23: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
compiling ruby_xml_attr.c
compiling ruby_xml_attr_decl.c
ruby_xml_attr_decl.c: In function 'rxml_attr_decl_name_get':
ruby_xml_attr_decl.c:57:5: warning: pointer targets in passing argument 2 of 'rxml_new_cstr' differ in signedness [-Wpointer-sign]
ruby_xml_encoding.h:11:7: note: expected 'const char *' but argument is of type 'const xmlChar *'
compiling ruby_xml_attributes.c
compiling ruby_xml_cbg.c
compiling ruby_xml_document.c
ruby_xml_document.c: In function 'rxml_document_canonicalize':
ruby_xml_document.c:232:10: warning: unused variable 'list_in' [-Wunused-variable]
ruby_xml_document.c:334:3: warning: passing argument 4 of 'xmlC14NDocDumpMemory' from incompatible pointer type [enabled by default]
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2/libxml/c14n.h:76:3: note: expected 'xmlChar **' but argument is of type 'xmlChar * (*)[256]'
ruby_xml_document.c:199:7: warning: variable 'length' set but not used [-Wunused-but-set-variable]
ruby_xml_document.c: In function 'rxml_document_root_set':
ruby_xml_document.c:757:14: warning: variable 'xroot' set but not used [-Wunused-but-set-variable]
ruby_xml_document.c: In function 'rxml_document_save':
ruby_xml_document.c:805:13: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
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
ruby_xml_html_parser_context.c: In function 'rxml_html_parser_context_options_set':
ruby_xml_html_parser_context.c:307:7: warning: variable 'result' set but not used [-Wunused-but-set-variable]
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: In function 'rxml_node_to_s':
ruby_xml_node.c:622:54: error: dereferencing pointer to incomplete type
ruby_xml_node.c:624:56: error: dereferencing pointer to incomplete type
make: *** [ruby_xml_node.o] Error 1
Gem files will remain installed in /Users/iandonovan/.rvm/gems/ruby-1.9.3-p392@standard-set/gems/libxml-ruby-2.3.3 for inspection.
Results logged to /Users/iandonovan/.rvm/gems/ruby-1.9.3-p392@standard-set/gems/libxml-ruby-2.3.3/ext/libxml/gem_make.out
An error occurred while installing libxml-ruby (2.3.3),and Bundler cannot continue
Make sure that `gem install libxml-ruby -v '2.3.3'` succeeds before bundling.

运行独立的gem安装,gem install libxml-ruby -v’2.3.3′,返回相同的错误消息.

安装XCode 5.0.1以及开发人员工具.由于“网络问题”(根据对话框),我无法通过xcode-select –install安装开发工具,而是从developer.apple.com下载了Mavericks软件包.

还有其他人处理过这件事吗? Nokogiri似乎安装得很好(1.5.9捆绑),但libxml-ruby无法完成.

解决方法

安装的libxml-ruby版本太旧而无法与libxml2版本兼容.大概你有最新的libxml2版本–2.9.1.

在版本2.4.0之前,libxml-ruby与libxml2 2.9.x不兼容.您可以在此处找到更多信息 – https://github.com/xml4r/libxml-ruby/blob/master/HISTORY.

为什么要安装这样一个旧版本的libxml-ruby?如果您尝试安装更新版本,它应该可以正常工作.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读