【问题标题】:Why do I get "file is not of required architecture" installing Ruby 1.9.3 using RVM on Mac OSX 10.6?为什么在 Mac OSX 10.6 上使用 RVM 安装 Ruby 1.9.3 时出现“文件不是必需的架构”?
【发布时间】:2012-06-16 01:58:36
【问题描述】:

我正在尝试在 Mac OSX 10.6 上安装 Ruby 1.9.3。我已经很好地安装了 10.8.7。 StackOverflow 上已经有很多这样的主题,但他们的修复一直没有奏效。 以下是终端打印出来的内容:

Installing Ruby from source to: /Users/cavan/.rvm/rubies/ruby-1.9.3-p194, this may take a while depending on your cpu(s)...
ruby-1.9.3-p194 - #fetching 
ruby-1.9.3-p194 - #extracted to /Users/cavan/.rvm/src/ruby-1.9.3-p194 (already extracted)
ruby-1.9.3-p194 - #configuring 
ruby-1.9.3-p194 - #compiling 
Error running 'make ', please read /Users/cavan/.rvm/log/ruby-1.9.3-p194/make.log
There has been an error while running make. Halting the installation.

这是它请求的日志的错误部分:

linking shared-object digest/md5.bundle
compiling rmd160init.c
ld: in /usr/local/lib/libz.1.dylib, file is not of required architecture
collect2: ld returned 1 exit status
make[2]: *** [../../../.ext/x86_64-darwin10.7.0/digest/md5.bundle] Error 1
make[1]: *** [ext/digest/md5/all] Error 2
make[1]: *** Waiting for unfinished jobs....
compiling rmd160ossl.c
installing default rmd160 libraries
linking shared-object digest/rmd160.bundle
ld: in /usr/local/lib/libz.1.dylib, file is not of required architecture
collect2: ld returned 1 exit status
make[2]: *** [../../../.ext/x86_64-darwin10.7.0/digest/rmd160.bundle] Error 1
make[1]: *** [ext/digest/rmd160/all] Error 2
make: *** [build-ext] Error 2

我认为这与“文件不是必需的架构消息”有关。我的电脑是 10.6 的,是 64 位的。

【问题讨论】:

  • file /usr/local/lib/libz.1.dylib 的输出是什么?
  • 它没有打开或运行。 “发生意外错误(错误代码 -43)。”我认为这意味着 xcode 存在问题。
  • 问题肯定是那个文件。您应该找出安装它的内容(我认为不是 Xcode,因为它不在我使用最新 Xcode 的机器上),并且可能只是将其删除。 Ruby 不需要它来编译,因为它已经随 OS X AFAIK 一起提供。
  • 当你需要 64 的时候,很有可能这是一个 32 位的库。这是 zlib,用于压缩。您需要获得 64 位版本。如果您使用 MacPorts 并从 Leopard 升级到 Snow Leopard,则存在一个已知问题,可以通过重新安装 MacPorts 来修复。如果没有,您可以尝试获取 zlib 源代码并在 ruby​​ 之前构建/安装这些源代码。

标签: ruby


【解决方案1】:

您在编译不同的库时遇到问题,我在为 OSX 构建 RailsInstaller 时已经解决了这些问题 => http://railsinstaller.org/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-23
    • 1970-01-01
    相关资源
    最近更新 更多