xcode - 在安装 pod 期间,我收到此错误
问题描述
无法从中提取 git 版本git --version
。相反,我看到:
xcrun: error: active developer path ("/Users/mcbook/Downloads/Xcode.app/Contents/Developer") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man xcode-select` for more details.
解决方案
与所有 macOS 应用程序一样,Xcode 应用程序在文件系统中表示为一个文件夹,即使在 Finder 中我们将其视为一个图标。
在 Xcode 的例子中,它的主 app 文件夹包含子目录,其中包含一些命令行开发工具,这些工具在安装需要编译的应用程序时是必需的。
当你第一次运行 Xcode 时,它会为你注册这个子文件夹的位置。不幸的是,看起来你第一次运行 Xcode 时它还在你的Downloads
文件夹中,所以你所有的命令行工具仍在那里寻找它。
我假设在此期间您已经将 Xcode(正如您所期望的那样,它也将所有应用程序文件夹的文件和子文件夹也移动到了您的/Applications
文件夹中)。
您应该能够使用以下命令行命令重定向所有工具以查看新的正确位置:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
推荐阅读
- c++ - 函数重新分配c字符串后delete []时出现无效指针错误
- java - 在 Intellij IDEA 中用 build.gradle 替换 Build Artifact
- angular - Angular 中的条件布局,带有两个导航栏
- excel - Excel公式用逗号从单元格中分隔数字
- python - 如何使用注意力机制对 RNN 建模以进行非文本分类?
- python - sqlalchemy-sqlite 数据库当前(01/2018)是否与 JSON 对象直接兼容?
- jquery - 如何在 JQUERY 中选择具有特定属性的 div 内的元素?
- javascript - 如何获取函数中父标签的属性值?
- mysql - MYSQL中带参数的存储过程
- html - 将材质 ui 表包裹在 div 内