xcode OSX 10.8 xcrun(没有那个文件或目录)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13041525/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
OSX 10.8 xcrun (No such file or directory)
提问by Lukas Grebe
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:
gem install jekyll
在 OSX 10.8 上执行时,安装了来自 Apple 开发者站点的独立命令行工具包(没有 Xcode),我遇到了以下错误:
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
构建本机扩展。这可能需要一段时间...
错误:安装 jekyll 时出错:
错误:无法构建 gem 本机扩展。
…
…
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:
安装了 gcc:
$ which cc
/usr/bin/cc
the look-up path for xcrun is set:
xcrun 的查找路径设置为:
xcode-select -print-path
/usr/bin
yet no matter which arguments i try, xcrun will always return
但无论我尝试哪种参数,xcrun 都会返回
xcrun: Error: failed to exec real xcrun. (No such file or directory)
xcrun:错误:无法执行真正的 xcrun。(无此文件或目录)
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…
man xcrun
读取“当 xcrun 以名称 xcrun 调用时,标志 -log 和 -verbose 是有用的调试辅助工具。标志 -no-cache 可用于绕过缓存查找。” 但这些似乎都没有任何效果:唯一的输出仍然是上面的……
Solution:following Ned Deily's advice below, i've replaced xcrun with a shell script to simply call the given arguments:
解决方案:按照下面 Ned Deily 的建议,我用 shell 脚本替换了 xcrun 以简单地调用给定的参数:
#!/bin/bash
$@
采纳答案by Ned Deily
Unfortunately, at least the last time I played with it, I found you really can't use xcrun
with just the standalone Command Line Tools
package. It apparently wasn't designed for that use case; the standalone package is a fairly recent innovation with Xcode 4. If the product you are trying to install really depends on xcrun
, you may need to install the full Xcode.app
distribution to get around it. That, or modify the distribution's Makefile et al to not use xcrun
. Or, possibly (untested), create some directories and/or symlinks to fake xcrun
into thinking you have Xcode.app
installed - a messy hack.
不幸的是,至少在我最后一次使用它时,我发现你真的不能xcrun
只使用独立Command Line Tools
包。它显然不是为那个用例设计的。独立软件包是 Xcode 4 的一项相当新的创新。如果您尝试安装的产品确实依赖于xcrun
,您可能需要安装完整的Xcode.app
发行版才能绕过它。那个,或者修改发行版的 Makefile 等以不使用xcrun
. 或者,可能(未经测试)创建一些目录和/或符号链接以假装xcrun
认为您已Xcode.app
安装 - 一个凌乱的黑客。
回答by bitoiu
Type in these commands on the console:
在控制台中输入这些命令:
sudo xcode-select -switch /usr/bin
sudo mv /usr/bin/xcrun /usr/bin/xcrun-orig
sudo vim /usr/bin/xcrun
Enter the following into your dummy xcrun file:
在您的虚拟 xcrun 文件中输入以下内容:
#!/bin/sh
$@
Then make it executable:
然后使其可执行:
sudo chmod 755 /usr/bin/xcrun
回答by Rob Napier
Even with Command Line Tools installed, your xcode-select is strange. It should be pointing into your XCode bundle, not /usr/bin
:
即使安装了命令行工具,您的 xcode-select 也很奇怪。它应该指向您的 XCode 包,而不是/usr/bin
:
$ xcode-select -print-path
/Applications/Xcode.app/Contents/Developer
Switch it to Xcode like this:
像这样将其切换到 Xcode:
$ sudo xcode-select --switch /Applications/Xcode.app
回答by deinspanjer
I was having trouble with brew install hg. It was choking on the output of xcodebuild -version.
我在 brew install hg 上遇到了麻烦。它在 xcodebuild -version 的输出上窒息。
It is a horrible hack, but I replaced /usr/bin/xcodebuild with a shell script that just echoed "4.3" and was able to install mecurial successfully.
这是一个可怕的黑客,但我用一个 shell 脚本替换了 /usr/bin/xcodebuild ,该脚本只回显了“4.3”并且能够成功安装 mecurial。