command line tools for new 10.9 OSX for ruby gems?
Solution 1:
TLDR:
xcode-select --install
In OS X 10.9, the command line developer tools are now installed on demand when they are used (this is the popup you mention seeing in a later comment).
The first time something tries to use one of the command line tools, the popup will be presented and the original command will return with a message that the command line tools need to be installed and with an error code. In this case, the problem is that the ruby process is hiding the message about the command line tools being needed.
If you wish to explicitly install the command line tools (instead of waiting for the popup to be triggered), you can run xcode-select --install
. The command line tools package is also available as an independent download from http://developer.apple.com/downloads.
Note that if you have Xcode installed on your system, you should no longer need the separate command line tools package, the tools in /usr/bin will automatically use the ones located inside of the Xcode application. This is why the Xcode UI no longer offers the option to install the command line tools for you.
Solution 2:
For others running into this problem, I had to also install apple-gcc via brew to get it to work:
brew install apple-gcc42
Solution 3:
I had this same problem installing gems after upgrading to OSX Mavericks. I saw this among the error messages:
make: gcc-4.2: No such file or directory
Which suggested that it's having trouble finding gcc. When I type "ls /usr/bin", I see that I have "gcc" but not "gcc-4.2". So I set up a symlink to tell it to look in "gcc" instead of "gcc-4.2", like so:
sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
This fixed my problem. Hope it helps.