简体   繁体   English

如何在OSX 10.9.3上安装命令行工具?

[英]How to install Command Line Tools on OSX 10.9.3?

I found this command: xcode-select --install . 我找到了以下命令: xcode-select --install But if I run it, I get: 但是,如果我运行它,则会得到:

Usage: xcode-select -print-path
   or: xcode-select -switch <xcode_folder_path>
   or: xcode-select -version
Arguments:
   -print-path                     Prints the path of the current Xcode folder
   -switch <xcode_folder_path>     Sets the path for the current Xcode folder
   -version                        Prints xcode-select version information

Not the installation process. 不是安装过程。 XCode is 5.1.1. XCode是5.1.1。

If I open preferences in XCode, everything seems to be installed. 如果我在XCode中打开首选项,似乎一切都已安装。

I've tried to download the "Command Line Tools" from https://developer.apple.com/downloads/index.action# , the package for Mountain Lion from April, March and October, but when I ran each of them, I got this error message: 我尝试从https://developer.apple.com/downloads/index.action# (山狮的软件包从4月,3月和10月)下载“命令行工具”,但是当我分别运行它们时,我收到此错误消息: 在此处输入图片说明 So at the moment, I don't know what or how to install it. 所以目前,我不知道该如何安装或如何安装它。

The problem is, that when I run bundle update in my Rails app, I get the error message 问题是,当我在Rails应用程序中运行bundle update时,出现错误消息

You have to install development tools first.

How to proceed now? 现在如何进行?

EDIT: I managed to install the Command Line Tools from the package, but when I run then the gem installation, the error is still the same: 编辑:我设法从软件包中安装了命令行工具,但是当我运行然后进行gem安装时,错误仍然相同:

You have to install development tools first.

I tested if command line tools are installed like this: 我测试了是否按以下方式安装了命令行工具:

xcode-select -print-path
/Applications/Xcode.app/Contents/Developer

xcode-select -version
xcode-select version 2003.

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

But this should mean it's installed, right? 但这应该意味着它已经安装了,对吧? But when I try to install a gem, I get still the line about missing You have to install development tools first. 但是,当我尝试安装gem时,仍然会遗漏您必须首先安装开发工具的路线

**EDIT2: When I run the brew doctor`, I get this (I guess there might be a connection): ** EDIT2:当我运行Brew医生时,我得到了(我想可能存在连接):

Warning: Setting DYLD_* vars can break dynamic linking.
Set variables:
    DYLD_LIBRARY_PATH

Warning: You have an outdated version of /usr/bin/install_name_tool installed.
This will cause binary package installations to fail.
This can happen if you install osx-gcc-installer or RailsInstaller.
To restore it, you must reinstall OS X or restore the binary from
the OS packages.

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:

    /opt/ImageMagick/bin/Magick++-config
    /opt/ImageMagick/bin/Magick-config
    /opt/ImageMagick/bin/MagickCore-config
    /opt/ImageMagick/bin/MagickWand-config
    /opt/ImageMagick/bin/Wand-config

Warning: Your XQuartz (2.7.4) is outdated
Please install XQuartz 2.7.6:
  https://xquartz.macosforge.org

Warning: You seem to have osx-gcc-installer installed.
Homebrew doesn't support osx-gcc-installer. It causes many builds to fail and
is an unlicensed distribution of really old Xcode files.
Please run `xcode-select --install` to install the CLT.

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
    /usr/local/lib/libMagickCore-6.Q8.1.dylib
    /usr/local/lib/libMagickWand-6.Q8.1.dylib

Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .la files:
    /usr/local/lib/libMagickCore-6.Q8.la
    /usr/local/lib/libMagickWand-6.Q8.la

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
    /usr/local/lib/pkgconfig/ImageMagick-6.Q8.pc
    /usr/local/lib/pkgconfig/ImageMagick.pc
    /usr/local/lib/pkgconfig/MagickCore-6.Q8.pc
    /usr/local/lib/pkgconfig/MagickCore.pc
    /usr/local/lib/pkgconfig/MagickWand-6.Q8.pc
    /usr/local/lib/pkgconfig/MagickWand.pc
    /usr/local/lib/pkgconfig/Wand-6.Q8.pc
    /usr/local/lib/pkgconfig/Wand.pc

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:

    libpng

If you have the development tools installed, and correct version selected, but you still get the error, you can try following steps which fixed it for me: 如果您已经安装了开发工具,并且选择了正确的版本,但是仍然出现错误,则可以尝试按照以下步骤为我修复的错误:

  1. Download OS X installation from the App Store (for me it was in /Applications/Install\\ OS\\ X\\ Yosemite.app ). 从App Store下载OS X安装(对我来说,它在/Applications/Install\\ OS\\ X\\ Yosemite.app )。
  2. Open the InstallESD.dmg image: open /Applications/Install\\ OS\\ X\\ Yosemite.app/Contents/SharedSupport/InstallESD.dmg . 打开InstallESD.dmg映像: open /Applications/Install\\ OS\\ X\\ Yosemite.app/Contents/SharedSupport/InstallESD.dmg
  3. Look for Essentials.pkg in Packages folder. 在“ 软件包”文件夹中查找Essentials.pkg
  4. Run the Essentials installation. 运行Essentials安装。

WARNING: Please beware that reinstalling parts of you OS might break it and I don't take responsibility for it, so backup before you hack around :-) !!! 警告:请注意,重新安装操作系统的某些部分可能会破坏它,我对此不承担任何责任,因此请在备份之前进行备份:-) !!!

Alternatively you can buy a software (eg AnyToIso or Pacifist ) and extract just the needed file. 或者,您可以购买软件(例如AnyToIsoPacifist ),然后仅提取所需的文件。

UPDATE: The extracted file can be found on Clinic's GitHub repo . 更新:提取的文件可以在Clinic的GitHub repo上找到

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

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