简体   繁体   English

手动安装Xcode命令行工具不起作用

[英]Manual Install of Xcode command line tools not working

I've manually installed the Xcode command line tools from the Apple website, and I went through the install process but it doesn't seem to be working. 我已经从Apple网站手动安装了Xcode命令行工具,并经历了安装过程,但似乎无法正常工作。 I ran this from the terminal to see if it installed: 我从终端运行此命令以查看是否已安装:

Zach-Boyette-MacBook-Pro-2:~ zachboyette$ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 5.1.0.0.1.1396320587
volume: /
location: /
install-time: 1398301024
groups: com.apple.FindSystemFiles.pkg-group com.apple.DevToolsBoth.pkg-group  com.apple.DevToolsNonRelocatableShared.pkg-group 

So it looks like the command line tools have installed, but when I run this: 因此,看起来好像已经安装了命令行工具,但是当我运行此命令时:

Zach-Boyette-MacBook-Pro-2:~ zachboyette$ xcode-select --install

A popup says: The "xcode-select" command requires the command line developer tools. 弹出窗口显示:“ xcode-select”命令需要命令行开发人员工具。 Would you like to install the tools now? 您想立即安装工具吗?

I clicked install and then it said: Can't install the software because it is not currently available from the Software Update server. 我单击安装,然后它说:无法安装软件,因为当前无法从软件更新服务器获得该软件。

I've read on other answers that the solution is to do a manual install, but I just did that so I don't understand why it's not working. 我已经阅读了其他答案,该解决方案是手动安装,但是我只是这样做,所以我不明白为什么它不起作用。 Also, in Xcode downloads, it's not showing the Command Line Tools. 另外,在Xcode下载中,它没有显示命令行工具。

I've tried installing it manually many times so I don't know why it's not working. 我已经尝试过多次手动安装它,所以我不知道为什么它不起作用。

Installing Jekyll still won't work: 安装Jekyll仍然无法进行:

Zach-Boyette-MacBook-Pro-2:~ zachboyette$ sudo gem install jekyll
Password:
Building native extensions.  This could take a while...
ERROR:  Error installing jekyll:
ERROR: Failed to build gem native extension.
EDIT: echo $PATH returns this:

Zach-Boyette-MacBook-Pro-2:~ zachboyette$ echo $PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/zachboyette/.rvm/bin

Command Line Tools are not included in XCode 5.1.1 You have to install it manually, BUT DON'T USE "xcode-select --install". XCode 5.1.1中不包含命令行工具,您必须手动安装它,但不要使用“ xcode-select --install”。 It does not work. 这是行不通的。

  1. Open Xcode app. 打开Xcode应用。
  2. Click on Xcode > Open Developer Tools > More Developers Tools. 单击Xco​​de>打开开发人员工具>更多开发人员工具。 That will take you to Downloads for Apple Developers web site. 这将带您到Apple Developers下载网站。 Use your AppStore Id to login. 使用您的AppStore ID登录。
  3. Download Command Line Tools for your Mac OS X version. 为您的Mac OS X版本下载命令行工具。

I have stumbled across this issue before when I completely hosed my development environment by deleting an ancient Xcode version. 在我删除旧的Xcode版本完全完成开发环境之前,我曾偶然发现过这个问题。

Have you tried running sudo xcode-select -r to clean up? 您是否尝试过运行sudo xcode-select -r进行清理? This sorted my problem. 这解决了我的问题。

From the man page: 从手册页:

-r, --reset
              Unsets  any  user-specified  developer  directory,  so  that the
              developer directory will be found via the default search  mecha-
              nism.  This  command must be run with superuser permissions (see
              sudo(8)), and will affect all users on the system.

The easiest work around is to install the XCode app from the App Store then open XCode and agree to the Terms and Conditions. 最简单的解决方法是从App Store安装XCode应用程序,然后打开XCode并同意条款和条件。

From there the Command Line Developer Tools package can be installed on using xcode-select --install or by trying to use any command line developer tool in Terminal like git . 从那里可以使用xcode-select --install或通过尝试在Terminal中使用任何命令行开发工具(如git来安装Command Line Developer Tools软件包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM