代码之家  ›  专栏  ›  技术社区  ›  dombesz

/usr/local/lib/libz.1.dylib,文件是为i386构建的,而i386不是正在链接的体系结构(x86_64)

  •  5
  • dombesz  · 技术社区  · 14 年前

    在我的Mac上安装了一些东西时遇到了这个问题,

    /usr/local/lib/libz.1.dylib, file was built for i386 which is not the architecture being linked (x86_64)
    

    日志看起来像:

    xslt_stylesheet.c:127: warning: passing argument 1 of ‘Nokogiri_wrap_xml_document’ with different width due to prototype
    cc -dynamic -bundle -undefined suppress -flat_namespace -o nokogiri.bundle     
    html_document.o html_element_description.o html_entity_lookup.o   html_sax_parser_context.o nokogiri.o xml_attr.o xml_attribute_decl.o xml_cdata.o xml_comment.o xml_document.o xml_document_fragment.o xml_dtd.o xml_element_content.o xml_element_decl.o xml_encoding_handler.o xml_entity_decl.o xml_entity_reference.o xml_io.o xml_libxml2_hacks.o xml_namespace.o xml_node.o xml_node_set.o xml_processing_instruction.o xml_reader.o xml_relax_ng.o xml_sax_parser.o xml_sax_parser_context.o xml_sax_push_parser.o xml_schema.o xml_syntax_error.o xml_text.o xml_xpath_context.o xslt_stylesheet.o -L. -L/usr/local/lib -L/opt/local/lib -L/usr/local/lib -L/usr/lib -L.     -lruby -lexslt -lxslt -lxml2  -lpthread -ldl -lobjc   
    ld: in /usr/local/lib/libz.1.dylib, file was built for i386 which is not the architecture being linked (x86_64)
    collect2: ld returned 1 exit status
    make: *** [nokogiri.bundle] Error 1
    
    3 回复  |  直到 9 年前
        2
  •  14
  •   Carlos Precioso    11 年前

    1. sudo rm /opt/local/lib/libz*
    2. its webpage
    3. ./configure make sudo make install
    4. RVM

        3
  •  1
  •   Parag Gupta    9 年前
    • /usr/local/opt/zlib/ brew install zlib /usr/local/Cellar/
    • libz.* /usr/local/lib/
    • gem install nokogiri -v '<version>' --with-zlib-dir=<zlib directory path from step 1>

    现在必须安装Nokogiri。再次还原备份libz。