xcode 无法在 OSX Mavericks 上安装命令行工具
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19691701/
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
Failed to install command line tools on OSX Mavericks
提问by Loourr
I tried to install the command line tools on Mavericks following the steps in this very useful post
我尝试按照这篇非常有用的帖子中的步骤在 Mavericks 上安装命令行工具
> xcode-select --install
but after a few short seconds I get the message
但几秒钟后我收到了消息
This seems wrong. Does anyone know how to solve this problem?
这似乎是错误的。有谁知道如何解决这个问题?
Whenever I navigate to the page that @Nikos M. is suggesting
每当我导航到@Nikos M. 建议的页面时
I get this message
我收到这条消息
I followed @Rich's suggestion and I was able to download the package and install it which I wasn't able to do before, but I've found that I still don't have access to a lot of the commands that I should like arp
or diskutil
just to name two that I've encountered recently.
我遵循了@Rich 的建议,并且能够下载并安装我以前无法执行的软件包,但是我发现我仍然无法访问许多我应该喜欢的命令arp
或diskutil
仅举出我最近遇到的两个。
采纳答案by Nikos M.
Install them from here. You must be a registered developer.
从这里安装它们。您必须是注册开发商。
Other solution is: in xcode click Xcode>Open Developer Tool>More Developer Tools
其他解决方案是:在 xcode 中点击 Xcode>Open Developer Tool>More Developer Tools
This should then take you to a link which will require a developer Apple ID sign in. From there, you'll be redirected after authenticating to https://developer.apple.com/download/more/where you can manually download and install the Command Line Tools.
这应该会将您带到一个需要开发人员 Apple ID 登录的链接。从那里,您将在身份验证后重定向到https://developer.apple.com/download/more/,您可以在其中手动下载和安装命令行工具。
回答by emery
The tools are still free, but xcode-select --install is no longer supported.
这些工具仍然是免费的,但不再支持 xcode-select --install。
To install the latest command-line developer tools from https://developer.apple.com,
要从https://developer.apple.com安装最新的命令行开发人员工具,
- Applications -> App Store -> Search -> XCode -> Install ... install XCode if you don't have it.
- Open XCode and close any pop-ups
- Go to the Xcode menu > Open Developer Tool > More Developer Tools... this opens the correct website.
- Find the newest version, download the dmg and install the package. The filename you're looking for is similar to "Command Line Tools (OS X 10.9).pkg"
- 应用程序 -> App Store -> 搜索 -> XCode -> 安装 ... 如果您没有 XCode,请安装它。
- 打开 XCode 并关闭所有弹出窗口
- 转到 Xcode 菜单 > 打开开发人员工具 > 更多开发人员工具...这将打开正确的网站。
- 找到最新版本,下载 dmg 并安装软件包。您要查找的文件名类似于“命令行工具 (OS X 10.9).pkg”
回答by Grey
I had this problem for months and finally found the solution.
我有这个问题几个月了,终于找到了解决方案。
The problem was: I had installed it before and removed it manually. (I had problems with the bundled git. It was not the smartest move to do this.)
问题是:我之前安装过它并手动删除了它。(我对捆绑的 git 有问题。这样做并不是最明智的举动。)
What i didn't remove were the files
我没有删除的是文件
/var/db/receipts/com.apple.pkg.CLTools_Executables.bom
/var/db/receipts/com.apple.pkg.CLTools_Executables.plist
Delete them, run xcode-select --install
-> no error anymore
删除它们,运行xcode-select --install
-> 不再出错
At least it worked for me. Hope it is helpful for somebody.
至少它对我有用。希望它对某人有帮助。
回答by Rich
I get that "Your Session has Expired" message when I try to download from within the Chrome browser. If I navigate to the site with Safari and sign in with my developer credentials then the Command Line Tools dmg downloads without a problem. I do not have a paid developer account either, btw.
当我尝试从 Chrome 浏览器中下载时,我收到“您的会话已过期”消息。如果我使用 Safari 导航到该站点并使用我的开发人员凭据登录,则命令行工具 dmg 下载没有问题。我也没有付费开发者帐户,顺便说一句。
回答by Theresa Luu
You can download your Command Line Tools from daw.apple.com, but try it from Safari instead of Chrome.
您可以从 daw.apple.com 下载命令行工具,但可以从 Safari 而不是 Chrome 尝试。
I tried it with Chrome for a few hours and apple would not recognize my id/password (it is the same as your AppleID). It required me to change my password after each third try, which was challenging because it would not let you use any password you've used in the last three years.
我用 Chrome 尝试了几个小时,但苹果无法识别我的 ID/密码(它与您的 AppleID 相同)。它要求我在每三次尝试后更改我的密码,这很有挑战性,因为它不会让您使用过去三年中使用过的任何密码。
Signing in via Safari gave me no problems.
通过 Safari 登录没有问题。
The file you are going to look for is Command Line Tools (OS X Mavericks) for Xcode - Late October
您要查找的文件是 Xcode 的命令行工具 (OS X Mavericks) - 10 月下旬
If your terminal still says you need to install command line tools, it may be an issue with gcc-4.2. I was able to confirm that was the issue by following my terminal message after I ran "bundle install" on my rails app. If this is your issue, you will do the following follow Housen's solution here. Best of luck
如果您的终端仍然提示您需要安装命令行工具,则可能是 gcc-4.2 的问题。在我的 rails 应用程序上运行“捆绑安装”后,我能够通过遵循我的终端消息来确认这是问题所在。如果这是你的问题,你会做以下遵循奉先的解决方案在这里。祝你好运
回答by Kalimar Maia
I spent the day trying to solve this problem. I believe the error messages are just confused about installing Xcode. The real problem I had was a need to update gcc compiler. This happened to me because I skipped Mountain Lion, where that occurred. This blog postwas very helpful.
我花了一天时间试图解决这个问题。我相信错误消息只是对安装 Xcode 感到困惑。我遇到的真正问题是需要更新 gcc 编译器。这发生在我身上是因为我跳过了发生这种情况的山狮。这篇博文非常有帮助。
回答by Eitan Klein
I solved it by open XCode UI, then adding my apple account Xcode -> Preference -> Add my APPLE ID account
我通过打开 XCode UI 解决它,然后添加我的苹果帐户 Xcode -> Preference -> Add my APPLE ID account
Then repeat the xcode-select --install
然后重复xcode-select --install
回答by Ravi Kishore K
Try to install the command line tools following Error Message "Xcode alone is not sufficient on Sierra"
尝试在错误消息“在 Sierra 上仅靠 Xcode 是不够的”之后安装命令行工具
brew seems checks if the command line tools installed in this path:
brew 似乎检查此路径中是否安装了命令行工具:
/Library/Developer/CommandLineTools My case is: I tried to install brew on my new mac. After I installed Xcode, there was nothing in the above path but the command line tools were somehow installed to another location. (xcode-select -p tell me it was /Applications/Xcode.app/Contents/Developer) The way in stackoverflow can install the command line tools to
/Library/Developer/CommandLineTools 我的情况是:我试图在我的新 Mac 上安装 brew。安装 Xcode 后,上面的路径中没有任何内容,但是命令行工具以某种方式安装到另一个位置。(xcode-select -p 告诉我是/Applications/Xcode.app/Contents/Developer)stackoverflow中的方式可以安装命令行工具来
/Library/Developer/CommandLineTools Now I got brew working. But I am not sure if it is the best solution as there should be two copies of command line tools on my machine using this method.
/Library/Developer/CommandLineTools 现在我开始使用 brew 了。但我不确定这是否是最好的解决方案,因为我的机器上应该有两个使用这种方法的命令行工具副本。