17

After installing Xcode CLT 4.5.1 on OS X 10.8.2, I'm having issues installing native ruby gems which need to compiled.

The output error is the same as with running xcrun -find:

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

To which CLT location should xcode-select point to, since it's no longer at /Developer?

Edit: I don't have the Xcode app installed, only CLT.

ddario
  • 1,015
  • 3
  • 12
  • 25

6 Answers6

20

The new location seems to be (be sure to run as root):

sudo xcode-select -switch /Library/Developer/
Oxcug
  • 6,524
  • 2
  • 31
  • 46
jbowes
  • 4,062
  • 22
  • 38
11

Since your Xcode tools are installed in /usr/bin, you should

sudo xcode-select -switch /
konyak
  • 10,818
  • 4
  • 59
  • 65
5

With XCode 4.5 installed AND Command Line Tools installed, I had to use this to get MacPorts and other similar things (like Ruby Gems or Perl CPAN module installation) working:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/

I found that /Library/Developer did not work. Note that the Developer folder is not under /Library for me, it's under the app bundle file content folders.

I'm not sure why this is, but people googling this issue may come here and want to know the other commandline options that are commonly usable with xcode-select, thus this answer, even though it doesn't 100% apply to the original question (where command line tools are installed WITHOUT XCode).

Warren P
  • 65,725
  • 40
  • 181
  • 316
2

you probably want:

xcode-select -switch /Applications/Xcode.app

unless you have multiple installs. that is likely the location if you have one install (e.g. from the App Store). if you have multiple installs, you probably know which one you want.

you could also try updating this value from Xcode's Preferences > Locations > Command Line Tools popup.

justin
  • 104,054
  • 14
  • 179
  • 226
  • @DustMason yes. it was mentioned… in response to my answer (including an edit to the OP). – justin Jul 29 '13 at 23:10
1

Open XCode and go to preferences.

Verify that there is an option under "Command Line Tools"

The error went away for me, as soon as I specified my Xcode command line tools version. enter image description here

spuder
  • 17,437
  • 19
  • 87
  • 153
0

I got further from @jbowes xcode-select -switch /Library/Developer/ answer, but then I hit this:

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

I came across this thread (OSX 10.8 xcrun (No such file or directory)) which references a Gist that solved my problem:

https://gist.github.com/thelibrarian/5520597

It's gross, but it seems to be the only way to solve the issue with just the Command Line Tools (i.e. not a full-blown XCode installation).

Community
  • 1
  • 1
Stano
  • 353
  • 1
  • 13