Xcode 4.5 Command Line Tools - xcode-select issue

13,185

Solution 1

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

sudo xcode-select -switch /Library/Developer/

Solution 2

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

sudo xcode-select -switch /

Solution 3

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).

Solution 4

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.

Solution 5

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

Share:
13,185

Related videos on Youtube

ddario
Author by

ddario

Updated on October 17, 2022

Comments

  • ddario
    ddario over 1 year

    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.

  • Holger Just
    Holger Just over 11 years
    This does the trick, which is kinda weird considering that this directory only contains an Acknowledgements.rtf.
  • Eric M.
    Eric M. over 11 years
    I was hoping this would work for Ruby Motion as well, but no luck. That may, unfortunately, need for XCode to be installed in its entirety.
  • justin
    justin almost 11 years
    @DustMason yes. it was mentioned… in response to my answer (including an edit to the OP).
  • Andrea
    Andrea over 10 years
    use sudo !! to avoid to paste again