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

发布于 2024-09-19 13:29:05 字数 1438 浏览 4 评论 0原文

在我的 Mac 上安装几个东西时遇到这个问题, 我认为这个问题是由于将我的豹子升级为雪豹而引起的。我认为这个问题也与 macports 有关。

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

有什么想法吗?

更新

更具体地说,这种情况发生在安装 nokogiri gem 时

,日志如下所示:

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

having this problem on installing several things on my mac,
i think this problem is coming from upgrading my leopard to snow leopard. Also this problem also is linked with macports i think.

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

Any ideas?

Update

To be more specific this happens on installing nokogiri gem

and the log looks like:

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

ま昔日黯然 2024-09-26 13:29:05

这与 MacPorts 无关:
zlib 安装为 i386,因此您必须为 x86-64 构建它。操作方法如下:

  1. 更新:正如 Nick 在评论中所说,您首先必须删除旧的 zlib 文件:sudo rm /opt/local/lib/libz*
  2. 下载其网页中的 zlib 源代码
  3. 中打开终端
  4. 提取源代码,并在源位置./configuremakesudo make install
  5. 如果仍然不起作用,请删除 ruby​​ 并重新安装(您可以使用 RVM 来完成

希望对您有帮助。

This is not about MacPorts:
zlib is installed as i386, so you have to build it for x86-64. Here's how to do it:

  1. Update: As Nick says in his comment, you first have to remove old zlib files: sudo rm /opt/local/lib/libz*
  2. Download zlib source code from its webpage
  3. Extract the source, and open a terminal in source location
  4. ./configure, make and sudo make install
  5. If it still doesn't work, remove ruby and install it again (you can do it with RVM)

Hope it helped you.

玩物 2024-09-26 13:29:05
  • 您可能已安装 x86_64 编译的 zlib
    /usr/local/opt/zlib/ 或者执行 brew install zlib
    这将在 /usr/local/Cellar/ 中安装 zlib。
  • 暂时将 libz.*/usr/local/lib/ 删除到备份文件夹中。
  • 执行 gem install nokogiri -v '' --with-zlib-dir=<步骤 1 中的 zlib 目录路径>

现在必须安装 Nokogiri。再次恢复备份的libz。

  • You might have x86_64 compiled zlib installed in
    /usr/local/opt/zlib/ or alternatively do a brew install zlib
    this will install zlib in /usr/local/Cellar/.
  • Temporary remove libz.* from /usr/local/lib/ into a backup folder.
  • Do gem install nokogiri -v '<version>' --with-zlib-dir=<zlib directory path from step 1>

Nokogiri must be installed by now. Restore the backup libz again.

未蓝澄海的烟 2024-09-26 13:29:05

这是 macport 迁移到雪豹的问题,遗憾的是您必须重新安装 macports 和所有端口才能拥有正确的架构。请在此处阅读 wiki:https://trac.macports.org/wiki/Migration

It is a macport migration to snow leopard issue, sadly you have to reinstall macports and all the ports to have the right architecture. Read the wiki here: https://trac.macports.org/wiki/Migration

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文