如何在没有 Xcode 的情况下在 Mac OS X Mountain Lion 中安装 Ruby 1.9.3? [英] How can I install Ruby 1.9.3 in Mac OS X Mountain Lion without Xcode?

查看:66
本文介绍了如何在没有 Xcode 的情况下在 Mac OS X Mountain Lion 中安装 Ruby 1.9.3?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道在 OS X 10.8 Mountain Lion 上为 Ruby 1.9.3 构建开发机器的替代方法,不需要 Xcode.

I would like to know about alternative ways to build a development machine for Ruby 1.9.3 on OS X 10.8 Mountain Lion, that does not require Xcode.

在我写这个问题的时候,山狮现在是金大师,所以它可以被认为是最终版本.Xcode 不能说,那是一个预览版本.

Mountain Lion is now Golden Master as I'm writing this question, so it could be considered as final version. That cannot be said about Xcode, that is a preview release yet.

RVM 建议通过 Xcode 安装 osx-gcc-installer,但我不想弄乱我的系统.

RVM recommends to install osx-gcc-installer over Xcode, but I would like not to mess my system.

在没有 Xcode 的情况下在 Mountain Lion 上安装 Ruby 1.9.3 的最干净的方法是什么?

What is the cleanest way to install Ruby 1.9.3 on Mountain Lion without Xcode?

推荐答案

osx-gcc-installer 被证明是替换 Xcode 以安装 Ruby 1.9.3 的一个很好的选择

osx-gcc-installer turns out to be a very good option to replace Xcode in order to install Ruby 1.9.3

这些是我遵循的步骤:

  1. 下载&在此处安装最新版本的 osx-gcc-installer(GCC-10.7-v2 很好):https://github.com/kennethreitz/osx-gcc-installer
  2. 照常安装 RVM 并选择 1.9.3-head 作为默认 ruby​​ 安装:https://rvm.io/rvm/install/
  3. 安装 Homebrew:https://github.com/mxcl/homebrew/wiki/installation
  4. 安装 libksba 以解决与 Ruby 1.9.3 的一些依赖关系:brew install libksba

就是这样!您现在应该在 Mountain Lion 上安装了 Ruby 1.9.3,可以完美运行.

That's it! You should now have Ruby 1.9.3 installed on Mountain Lion working perfectly.

如果您需要其他一些软件包,现在通过 Homebrew 安装它们,例如 Imagemagick:brew install imagemagick

If you need some other packages, install them now through Homebrew, such as Imagemagick for example: brew install imagemagick

您可能需要 XQuartz for Homebrew 才能正常工作,因为自 Mountain Lion 以来 Apple 不再提供 X11.你可以在这里下载:http://xquartz.macosforge.org/trac/wiki

It's possible that you need XQuartz for Homebrew to work properly, as Apple is not shipping X11 since Mountain Lion. You can download it here: http://xquartz.macosforge.org/trac/wiki

现在(自 7 月 29 日起)Xcode 4.4 的命令行工具可用.

Now (since 29th July) Command line tools for Xcode 4.4 are available.

因此,新步骤如下:

  1. 下载&为 Xcode 4.4 安装命令行工具(您不需要下载 Xcode):https://developer.apple.com/downloads/index.action
  2. 安装 Homebrew:https://github.com/mxcl/homebrew/wiki/installation
  3. 安装 automake:brew install automake
  4. 照常安装RVM并选择1.9.3-head作为默认ruby安装:https://rvm.io/rvm/install/

可选步骤:某些组件可能需要 XQuartz,例如 Imagemagick,因此请下载 &安装 XQuartz:http://xquartz.macosforge.org/trac/wiki

Optional step: You may need XQuartz for some components, for example for Imagemagick, so download & install XQuartz: http://xquartz.macosforge.org/trac/wiki

这篇关于如何在没有 Xcode 的情况下在 Mac OS X Mountain Lion 中安装 Ruby 1.9.3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆