0

I'm installing RVM & Ruby without Xcode's Command Line Tools (on Mac OS X 10.8.2 (12C60) (Mountain Lion) with Xcode 4.5 (4G182)).

RVM installs fine. But, when I try to install Ruby, I get error: limits.h: No such file or directory https://gist.github.com/3789921#L241.

But, that file exists there because cat works and so does:

$ 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

So, why does bash say it doesn't exist?

The following questions are similar but unhelpful:

Community
  • 1
  • 1
ma11hew28
  • 121,420
  • 116
  • 450
  • 651
  • Not necessarily a criticism, but I know I started to move away from the manual-install method when I found JewelryBox: http://unfiniti.com/software/mac/jewelrybox – Jason M. Batchelor Oct 12 '12 at 14:24
  • 1
    How do you know that Ruby is trying to load "limits.h" from the same path you have listed? You say that bash says it does not exist, yet the error message does not say `bash`. – cdarke Oct 12 '12 at 14:30
  • Which command do you use to install Ruby, from which directory? It probably doesn't know that it should look in `/usr/local/...`. On Linux I would use `strace` to look at the full file paths that were tried by the installation program. – Martin Vidner Oct 12 '12 at 15:10
  • Any reason you don't have the command line tools installed? This is necessary to use a lot of different gems. – tadman Oct 12 '12 at 15:10
  • @cdarke the error in the question linked to the gist, but I realized that wasn't obvious, so I separated it out. – ma11hew28 Oct 12 '12 at 15:21
  • Udated the title to actually mention ruby, xocde, etc. – Michael Durrant Oct 12 '12 at 15:25
  • @tadman Similar to this reasoning: https://github.com/wayneeseguin/rvm/issues/1138. I have all the files on my system already. Installing the Command Line Tools just copies them into my system folders. I'd rather keep my system folders clean (a Homebrew principle) and tell the compiler to look in `xcode-select -print-path` instead. Also, Homebrew now works without installing the Command Line Tools. – ma11hew28 Oct 12 '12 at 15:32
  • I don't know how installing Apple produced software in your OS X system folder is somehow making things dirty. The command-line tools provide `/usr/bin/gcc` as well as the usual `/usr/include` stuff that a lot of programs expect. That you got it working without this is surprising. I didn't know that was possible. – tadman Oct 12 '12 at 15:41
  • @tadman I guess by clean, I meant DRY. Yea, I might just install them, but it'd be cool not to have to. So, I might try for a bit more... :) – ma11hew28 Oct 12 '12 at 15:46

1 Answers1

2

You need to install osx-gcc-installer (or command-line-tools + gcc-4.2) to make it working.

Read rvm requirements for information what is need for proper ruby installation.

mpapis
  • 52,729
  • 14
  • 121
  • 158