【问题标题】:Error installing Ruby without Xcode Command Line Tools: No such file, but it exists在没有 Xcode 命令行工具的情况下安装 Ruby 时出错:没有这样的文件,但它存在
【发布时间】:2012-10-03 09:15:02
【问题描述】:

我在没有 Xcode 命令行工具的情况下安装 RVM 和 Ruby(在 Mac OS X 10.8.2 (12C60) (Mountain Lion) 和 Xcode 4.5 (4G182) 上)。

RVM 安装良好。但是,当我尝试安装 Ruby 时,我得到了 error: limits.h: No such file or directory https://gist.github.com/3789921#L241

但是,该文件存在在那里,因为 cat 有效,所以也有效:

$ file /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/limits.h
/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/limits.h: ASCII c program text

那么,为什么 bash 说它不存在?

以下问题类似但无济于事:

【问题讨论】:

  • 不一定是批评,但我知道当我找到 JewelryBox 时我开始远离手动安装方法:unfiniti.com/software/mac/jewelrybox
  • 您怎么知道 Ruby 正试图从您列出的同一路径加载“limits.h”?你说 bash 说它不存在,但是错误信息没有说bash
  • 您使用哪个命令安装 Ruby,从哪个目录?它可能不知道它应该在/usr/local/... 中查找。在 Linux 上,我会使用 strace 查看安装程序尝试过的完整文件路径。
  • 您没有安装命令行工具的任何原因?这对于使用许多不同的宝石是必要的。
  • @cdarke 问题中的错误与要点相关,但我意识到这并不明显,所以我把它分开了。

标签: ruby macos bash compiler-errors rvm


【解决方案1】:

您需要安装 osx-gcc-installer(或命令行工具 + gcc-4.2)才能使其正常工作。

阅读rvm requirements 了解正确安装 ruby​​ 所需的信息。

【讨论】:

    猜你喜欢
    • 2021-01-27
    • 2013-09-30
    • 1970-01-01
    • 1970-01-01
    • 2013-10-04
    • 1970-01-01
    • 1970-01-01
    • 2015-01-08
    • 1970-01-01
    相关资源
    最近更新 更多