18

I didn't want to install the whole Xcode, so I just downloaded the command line tools for Xcode. I am trying to install ruby 1.9.3 via rvm. However, rvm complains that no xcode is selected:

xcode-select: Error: No Xcode is selected. Use xcode-select -switch , or see the xcode-select manpage (man xcode-select) for further information.

I read the xcode-select manpage and I know how to set the path to the Xcode Command Line Tools, but I don't know where they are installed. How do I find this out?

I am using OS X Mountain Lion.

Erik Kaplun
  • 37,128
  • 15
  • 99
  • 111
Alexander Popov
  • 23,073
  • 19
  • 91
  • 130
  • 2
    For those who are looking to find out the path of the command line tools: Enter `xcode-select -p` in Terminal – Marvin Rabe May 02 '16 at 10:03

5 Answers5

39

The entries in /usr/bin are just a front for whatever you choose with xcode-select:

$> /usr/bin/clang --version
Apple LLVM version 8.0.0 (clang-800.0.38)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

The standalone command line tools are installed in /Library/Developer/CommandLineTools:

$> sudo xcode-select -s /Library/Developer/CommandLineTools
$> /usr/bin/clang --version
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin 
Matthias Winkelmann
  • 15,870
  • 7
  • 64
  • 76
  • 1
    I have to say thank you here. If you want c compiler without Xcode (more than 10G), just download command line tools and then follow this guideline. – windmaomao Oct 09 '20 at 16:17
13

This worked for me: sudo xcode-select --reset

user14742503
  • 131
  • 1
  • 2
2

Short version: the answer to my problem is to install the full Xcode, not only the Command Line Tools.

Long version:

Based on this I found out, that the location of the tools is /usr/bin . So I ran sudo xcode-select -switch /usr/bin. After that however, I got this error:

Error: failed to exec real xcrun. (No such file or directory)

So based on this I install the full Xcode app, ran sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer and this solved my problem.

Community
  • 1
  • 1
Alexander Popov
  • 23,073
  • 19
  • 91
  • 130
  • This seems to be required for earlier versions of XCode, for example, XCode 8.3.3 which is the latest version that will run on OSX Sierra. – Matt Apr 11 '23 at 10:14
2

If you have your user folder on an external drive, this worked for me:

sudo xcode-select --switch /Library/Developer/CommandLineTools

For a standalone install.

0

this is not warning from RVM, most likely it is displayed by Homebrew, I got few complains about it but it was always harmless and installation of ruby completed without problems.

if you get errors show all of them not just one.

mpapis
  • 52,729
  • 14
  • 121
  • 158