简体   繁体   English

“捆绑安装”中的'gem install nokogiri'失败[Mac OS X Lion]

[英]'gem install nokogiri' fails in `bundle install` [Mac OS X Lion]

System: Mac OS X Lion 系统:Mac OS X Lion

running bundle install tells me to do: gem install nokogiri -v '1.5.2' 运行bundle install告诉我要做: gem install nokogiri -v '1.5.2'

Building native extensions.  This could take a while...
1ERROR:  Error installing nokogiri:
    ERROR: Failed to build gem native extension.

        /Users/ernsheong/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb
extconf.rb:10: Use RbConfig instead of obsolete and deprecated Config.
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... yes
checking for xmlParseDoc() in -lxml2... yes
checking for xsltParseStylesheetDoc() in -lxslt... yes
checking for exsltFuncRegister() in -lexslt... yes
checking for xmlHasFeature()... yes
checking for xmlFirstElementChild()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetValidStructuredErrors()... yes
checking for xmlSchemaSetValidStructuredErrors()... yes
checking for xmlSchemaSetParserStructuredErrors()... yes
creating Makefile

make
compiling html_document.c
compiling html_element_description.c
compiling html_entity_lookup.c
compiling html_sax_parser_context.c
compiling html_sax_push_parser.c
compiling nokogiri.c
compiling xml_attr.c
compiling xml_attribute_decl.c
compiling xml_cdata.c
compiling xml_comment.c
compiling xml_document.c
compiling xml_document_fragment.c
compiling xml_dtd.c
compiling xml_element_content.c
compiling xml_element_decl.c
compiling xml_encoding_handler.c
compiling xml_entity_decl.c
compiling xml_entity_reference.c
compiling xml_io.c
xml_io.c:28:10: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
  return safe_len;
  ~~~~~~ ^~~~~~~~
1 warning generated.
compiling xml_libxml2_hacks.c
compiling xml_namespace.c
compiling xml_node.c
compiling xml_node_set.c
compiling xml_processing_instruction.c
compiling xml_reader.c
compiling xml_relax_ng.c
compiling xml_sax_parser.c
compiling xml_sax_parser_context.c
compiling xml_sax_push_parser.c
compiling xml_schema.c
compiling xml_syntax_error.c
compiling xml_text.c
compiling xml_xpath_context.c
xml_xpath_context.c:189:30: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
  rb_raise(rb_eRuntimeError, message);
                             ^~~~~~~
1 warning generated.
compiling xslt_stylesheet.c
linking shared-object nokogiri/nokogiri.bundle
ld: warning: directory not found for option '-L/usr/local/Cellar/libxml2/2.7.8/lib'

make install
/usr/bin/install -c -m 0755 nokogiri.bundle /Users/ernsheong/.rvm/gems/ruby-1.9.3-p0/gems/nokogiri-1.5.2/lib/nokogiri
make: /usr/bin/install: No such file or directory
make: *** [/Users/ernsheong/.rvm/gems/ruby-1.9.3-p0/gems/nokogiri-1.5.2/lib/nokogiri/nokogiri.bundle] Error 1


Gem files will remain installed in /Users/ernsheong/.rvm/gems/ruby-1.9.3-p0/gems/nokogiri-1.5.2 for inspection.
Results logged to /Users/ernsheong/.rvm/gems/ruby-1.9.3-p0/gems/nokogiri-1.5.2/ext/nokogiri/gem_make.out

It is somewhat similar but still different from OS X Lion, Attempting Nokogiri install - libxml2 is missing and An error occurred while installing nokogiri (1.5.2) 它有些相似,但与OS X Lion仍然不同,尝试安装Nokogiri-缺少libxml2,并且在安装nokogiri(1.5.2)时发生了错误

Thanks in advance. 提前致谢。

i solved the problem by reinstalling ruby using the following Gist: gist.github.com/1856859 . 我通过使用以下Gist重新安装ruby解决了该问题: gist.github.com/1856859 A friend pointed out that the --with-gcc=clang option during install is important for Lion/Snow Leopard 一位朋友指出,安装过程中的--with-gcc = clang选项对于Lion / Snow Leopard非常重要

There is a minor issue in configre.in of stock ruby-1.9.3-p125. 库存ruby-1.9.3-p125的configre.in中存在一个小问题。 You may try using latest head of RVM as mentioned in " Issue updating Ruby on Mac with Xcode 4.3.1" 您可以尝试使用最新的RVM头,如“ 在Mac上使用Xcode 4.3.1更新Ruby问题”中所述

Other module may fail due to dynamic linking. 其他模块可能由于动态链接而失败。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM