gpt4 book ai didi

ruby - 无法在 Mojave 上安装任何版本的 ruby​​ - 内部 ranlib 命令失败

转载 作者:数据小太阳 更新时间:2023-10-29 06:59:33 24 4
gpt4 key购买 nike

我知道这个问题有一些类似的问题,但我找不到与我的问题相匹配的问题。

我无法使用 rvm 或 rbenv 安装任何版本的 ruby​​。两者都会导致相同的错误。例如,这是安装 ruby​​ 2.5.3 时的日志摘录:

compiling loadpath.c
making srcs under enc
linking static-library libruby.2.5.3-static.a
make[1]: Nothing to be done for `srcs'.
generating transdb.h
/opt/local/bin/ranlib: object: libruby.2.5.3-static.a(dln.o) malformed object (unknown load command 1)
ar: internal ranlib command failed
make: *** [libruby.2.5.3-static.a] Error 1
make: *** Waiting for unfinished jobs....
transdb.h updated

问题似乎出在这里:

/opt/local/bin/ranlib: object: libruby.2.5.3-static.a(dln.o) malformed object (unknown load command 1)
ar: internal ranlib command failed
make: *** [libruby.2.5.3-static.a] Error 1

我尝试过的

  • 安装、重新安装、卸载 rvm、rbenv。
  • 更新、重新安装 XCode。
  • 删除、安装 XCode 命令行工具。

这是什么原因造成的?

更新

gcc --version 返回:

gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.0 (clang-1000.10.44.4)
Target: x86_64-apple-darwin18.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

最佳答案

对于踩到同一个地雷的任何其他人,对我来说,这是通过 cctools 来自 homebrewranlib 的不兼容副本> 包裹。为了修复它,我刚刚卸载了它:

brew 卸载 cctools

关于ruby - 无法在 Mojave 上安装任何版本的 ruby​​ - 内部 ranlib 命令失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54363030/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com