问题描述
在OSX 10.8上执行 gem install jekyll
时,安装了Apple Developer Network的独立命令行工具包(无Xcode),我遇到以下错误:
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:
错误:安装jekyll时出错:
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:
gcc is installed:
$ which cc
/usr/bin/cc
设置xcrun的查找路径:
the look-up path for xcrun is set:
xcode-select -print-path
/usr/bin
无论我尝试使用哪个参数,xcrun都会返回
yet no matter which arguments i try, xcrun will always return
man xcrun
reads当xcrun是用名称xcrun调用,标志-log和-verbose是有用的调试帮助,标志-no-cache可以用来绕过缓存查找。但是这似乎没有任何影响:唯一的输出仍然是上述...
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…
解决方案:遵循Ned Deily的建议,我已经用shell脚本替换xcrun来简单地调用给定的参数:
Solution: following Ned Deily's advice below, i've replaced xcrun with a shell script to simply call the given arguments:
#!/bin/bash
$@
推荐答案
不幸的是,至少我上次玩过它,我发现只有独立的命令行工具
包才能使用 xcrun
。它显然不是为那个用例设计的;独立包是Xcode 4的一个相当新的创新。如果您尝试安装的产品真的取决于 xcrun
,则可能需要安装完整的 Xcode.app
发行版来解决它。那或者修改发行版的Makefile等,不要使用 xcrun
。或者,可能(未测试),创建一些目录和/或符号链接来假冒 xcrun
,认为您有 Xcode.app
安装 - 乱七八糟的黑客。
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.
这篇关于OSX 10.8 xcrun(没有这样的文件或目录)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!