如何在 Lion 上安装 Xcode 4.6,需要使用 RVM 升级 ruby

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19241809/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 04:02:44  来源:igfitidea点击:

How to install Xcode 4.6 on Lion, needed for upgrading ruby with RVM

rubyxcodervmosx-lionhomebrew

提问by gokeji

I was actually trying to update ruby on my OSX 10.7.5 with RVM, and after typing in the following command:

我实际上是在尝试使用RVM在我的 OSX 10.7.5 上更新 ruby ,并在输入以下命令后:

rvm install ruby

I got the following response:

我得到以下回复:

Searching for binary rubies, this might take some time.
Checking requirements for osx.
Installing requirements for osx.
Updating system.......
Error running 'requirements_osx_brew_update_system ruby-2.0.0-p247',
please read /Users/username/.rvm/log/1381215459_ruby-2.0.0-p247/update_system.log
Requirements installation failed with status: 1.

Then, when I checked out the update_system.log, it showed me the actual code of a function called requirements_osx_brew_update_system(), which contained the following error message:

然后,当我检出 时update_system.log,它向我展示了一个名为 的函数的实际代码requirements_osx_brew_update_system(),其中包含以下错误消息:

Xcode version older than 4.6.2 installed, download and install newer version from:

    http://connect.apple.com

After installation open Xcode, go to Downloads and install Command Line Tools.

Then I proceeded to find an update for Xcode, but only found the latest Xcode 5.0, which is apparently incompatible with my OSX 10.7. Although ultimately my goal is to update ruby and install rails, which I'm sure there are many other ways to do, I'd still like to find out if I could possibly install Xcode 4.6.2 on my OSX 10.7.

然后我继续寻找 Xcode 的更新,但只找到了最新的 Xcode 5.0,它显然与我的 OSX 10.7 不兼容。虽然最终我的目标是更新 ruby​​ 并安装 rails,我确信还有很多其他方法可以做到,但我仍然想知道是否可以在我的 OSX 10.7 上安装 Xcode 4.6.2。

采纳答案by jamby

It seems you're going to have to install under Xcode 5. So go to https://developer.apple.com/downloads/and log in with your developer ID to get to the older versions. There should be a 4.6.3 that you could potentially download, or even 4.6.2.

看来您必须在 Xcode 5 下安装。因此,请访问https://developer.apple.com/downloads/并使用您的开发人员 ID 登录以获取旧版本。应该有可能下载的 4.6.3,甚至 4.6.2。

Or you could upgrade your OSX to 10.8.

或者您可以将您的 OSX 升级到 10.8。

Whichever you prefer.

无论你喜欢哪个。

I can't give you a direct link to it, since you need your developer information to log in yourself. But all the downloads you need are in the link provided above once you log in.

我不能给你一个直接的链接,因为你需要你的开发者信息来自己登录。但是一旦您登录,您需要的所有下载都在上面提供的链接中。

回答by plainjimbo

UPDATE: Sorry folks, apparently my version of XCode is v4.6.1 so updating the command line tools will not work in all cases (I know for a fact it doesn't work if you're on XCode v4.3.3). YMMV

更新:抱歉各位,显然我的 XCode 版本是 v4.6.1,所以更新命令行工具在所有情况下都不起作用(我知道如果你使用的是 XCode v4.3.3,它就不起作用)。青年会

I ran into the same issue trying to do an rvm install. I got an error telling me that I needed XCode 4.6.2 or later.

我在尝试执行rvm install. 我收到一条错误消息,告诉我我需要 XCode 4.6.2 或更高版本。

Turns out all it needed was the latest version of the XCode command line tools. I followed the instructions for upgrading my command line tools from this macports article:

结果证明它只需要最新版本的 XCode 命令行工具。我按照此macports 文章中的升级命令行工具的说明进行操作:

  • open the Xcode application
  • go to the Preferences window
  • open the Downloads section
  • click the Install button next to "Command Line Tools"
  • 打开Xcode应用程序
  • 转到首选项窗口
  • 打开下载部分
  • 单击“命令行工具”旁边的“安装”按钮

After doing this I was able to run my rvm installcommand and it didn't complain about upgrading XCode anymore (and finished successfully).

这样做后,我能够运行我的rvm install命令,它不再抱怨升级 XCode(并成功完成)。

回答by llewellyn falco

Open xcode and update it via the app store.

打开 xcode 并通过应用商店更新它。

Then

然后

xcode-select --install

This will install xcode via the command line

这将通过命令行安装 xcode