When executing gem install jekyll
on OSX 10.8 with the standalone Command Line Tools package from Apple's Developer site installed (no Xcode), i run into the following error:
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
…
xcrun cc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -c porter.c
xcrun: Error: failed to exec real xcrun. (No such file or directory)
gcc is installed:
$ which cc
/usr/bin/cc
the look-up path for xcrun is set:
xcode-select -print-path
/usr/bin
yet no matter which arguments i try, xcrun will always return
xcrun: Error: failed to exec real xcrun. (No such file or directory)
man xcrun
reads "When xcrun is invoked with the name xcrun , the flags -log and -verbose are useful debugging aids. The flag -no-cache can be used to bypass cache lookup." but none of this seems to have any effect: the only output remains the above…
Solution: following Ned Deily's advice below, i've replaced xcrun with a shell script to simply call the given arguments:
#!/bin/bash
$@
Command Line Tools
package installed from the Apple Developer site without installingXcode.app
or do you have Xcode.app installed and then installed itsCommand Line Tools
component from theXcode.app
Preferences
menu? – Blenheimexport PATH=$HOME/local/bin:$PATH
to specify an override file of~/local/bin/xcrun
to include the hack. I also had to runsudo xcode-select -switch /usr/bin
to match the-print-path
. – Communist/usr/bin/xcrun
not anxcrun
override somewhere else in thePATH
. – Whoever