我可以在 OS X v10.6.8 上升级到当前版本的 Ruby (2.2.3) 吗?

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

Can I upgrade to the current version of Ruby (2.2.3) on OS X v10.6.8?

rubymacosterminal

提问by user70848

I'm looking at "Install Ruby on Rails · Mac OS X Yosemite", and in the instructions it says to update your OS which I don't really want to do because my computer is getting old.

我正在查看“安装 Ruby on Rails · Mac OS X Yosemite”,并且在说明中说要更新您的操作系统,我真的不想这样做,因为我的计算机变老了。

I also found "How to update Ruby to 1.9.x on Mac?". As far as I can tell, I don't have RVM and I'm afraid of yet another install, in case my system requirements still aren't good enough.

我还找到了“如何在 Mac 上将 Ruby 更新到 1.9.x?”。据我所知,我没有 RVM,我害怕再安装一次,以防我的系统要求仍然不够好。

Ultimately, I'm trying to update Jekyll, but I need to update my system a little bit first. I need Ruby 1.9.3 or later. Will "How to update Ruby to 1.9.x on Mac?" work? I'm running Ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin10.0]'.

最终,我正在尝试更新 Jekyll,但我需要先更新我的系统。我需要 Ruby 1.9.3 或更高版本。“如何在 Mac 上将 Ruby 更新到 1.9.x?” 工作?我正在运行 Ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin10.0]'。

EDIT: I did end up getting RVM installed. For those who find this page in the future, I ran into these issues/help pages:

编辑:我最终安装了 RVM。对于将来找到此页面的人,我遇到了以下问题/帮助页面:

回答by Linus Oleander

I suggest that you use RVMto install Ruby.

我建议你使用RVM来安装 Ruby。

curl -sSL https://get.rvm.io | bash -s stable --ruby

You need to restart the terminal in order to run rvm:

您需要重新启动终端才能运行 rvm:

rvm install 2.2
rvm use 2.2 --default

回答by Horatio

This is what worked for me

这对我有用

\curl -sSL https://get.rvm.io | bash -s stable --ruby

For the most up-to-date info on how to do this, check this documentation.

有关如何执行此操作的最新信息,请查看此文档

回答by Paula Hasstenteufel

In case anyone bumps into the same error I did: “Requirements installation failed with status: 1.”, you need to install homebrew.

万一有人遇到我做的同样的错误:“要求安装失败,状态:1。” ,你需要安装自制软件。

Use this:

用这个:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

回答by James B. Byrne

You do not need the latest version of OSX to run an updated version of Ruby. Whether or not you need something more current than 10.6.8 to run 2.2.3 I cannot tell. But 1.9.3 should build just fine and 2.2.3 likely will as well.

您不需要最新版本的 OSX 来运行更新版本的 Ruby。我不知道你是否需要比 10.6.8 更新的东西来运行 2.2.3。但是 1.9.3 应该构建得很好,2.2.3 也可能会。

Using rvm(or rbenv, or ruby-build, or whatever) is certainly an option if you are simply doing development. Then you can have multiple ruby versions at your command without having to disturb the system ruby. Be aware these are not a panacea. Each has its own complexities and egocentricities. Go to the project websites and read the documentation carefully or you can easily get betrayed by your assumptions about how things 'should' work.

如果您只是进行开发,则使用rvm(or rbenv, or ruby-build, 或其他) 当然是一种选择。然后你可以在你的命令中有多个 ruby​​ 版本,而不必打扰系统 ruby​​。请注意,这些不是灵丹妙药。每个人都有自己的复杂性和自我中心。转到项目网站并仔细阅读文档,否则您很容易被您对事情“应该”如何运作的假设所背叛。

All of ruby version managers should install on any version of OSX that supports the build tools required by the Ruby that you want to host. However, be aware you will need installed the OSX xcode application for your system (available free from the Apple App Store but you need an account) and you will need the optional command line tools for xcode as well (also from the App Store).

所有 ruby​​ 版本管理器都应该安装在任何支持您要托管的 Ruby 所需的构建工具的 OSX 版本上。但是,请注意,您需要为您的系统安装 OSX xcode 应用程序(可从 Apple App Store 免费获得,但您需要一个帐户)并且您还需要可选的 xcode 命令行工具(也来自 App Store)。

If you want to update the system ruby then take a look at either the homebrew or macports projects. These provide up to date versions of many, many linux projects for OSX, including Ruby (and git). You will need to meet the same xcode requirements. A build is a build wherever the binaries end up.

如果您想更新系统 ruby​​,请查看 homebrew 或 macports 项目。这些为 OSX 提供了许多 Linux 项目的最新版本,包括 Ruby(和 git)。您将需要满足相同的 xcode 要求。构建是在二进制文件结束的地方构建。

The system from which I am writing this answer once ran Snow Leopard and I had at least Ruby 1.9 dot somethinginstalled on it via Ports. I am currently paused at 10.9.5 and am running:

我写这个答案的系统曾经运行过 Snow Leopard,我至少Ruby 1.9 dot something通过 Ports 安装了它。我目前在 10.9.5 暂停并正在运行:

ruby --version
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin13] 

Without any problems.

没有任何问题。