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.

asked Oct 8, 2012 at 11:30

6 Answers 6

20

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

sudo xcode-select -switch /Library/Developer/
Oxcug
6,5942 gold badges33 silver badges47 bronze badges
answered Dec 10, 2012 at 17:53
Sign up to request clarification or add additional context in comments.

3 Comments

This does the trick, which is kinda weird considering that this directory only contains an Acknowledgements.rtf.
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.
use sudo !! to avoid to paste again
11

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

sudo xcode-select -switch /
answered Jan 15, 2013 at 6:12

1 Comment

the -switch / command does not work, but -switch /Library/Developer does. CLT installed.
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).

answered Jan 12, 2013 at 17:06

Comments

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.

answered Oct 8, 2012 at 11:55

1 Comment

@DustMason yes. it was mentioned... in response to my answer (including an edit to the OP).
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

answered Aug 6, 2013 at 18:48

Comments

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

answered Feb 5, 2014 at 17:32

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.