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

时间:2022-02-08 02:44:43

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”,在说明中它说要更新你的OS,我真的不想这么做,因为我的电脑老了。

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.

我还找到了“如何将Ruby更新到1.9”。x在Mac ?”。据我所知,我没有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或更高版本。Will "How to update Ruby to 1.9 "。x在Mac ?”工作?我正在运行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。对于那些将来发现这个页面的人,我遇到了这些问题/帮助页面:

4 个解决方案

#1


142  

I suggest that you use RVM to 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

#2


6  

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.

有关如何进行此操作的最新信息,请参阅本文档。

#3


2  

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(或rbenv,或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应用程序(可以从苹果应用商店免费获得,但您需要一个帐户),您还需要xcode的可选命令行工具(也可以从应用商店获得)。

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 something installed on it via Ports. I am currently paused at 10.9.5 and am running:

我编写这个答案的系统曾经运行过Snow Leopard,我至少有Ruby 1.9通过端口在其上安装了一些东西。我现在暂停到10.9.5,正在运行:

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

Without any problems.

没有任何问题。

#4


2  

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)"

#1


142  

I suggest that you use RVM to 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

#2


6  

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.

有关如何进行此操作的最新信息,请参阅本文档。

#3


2  

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(或rbenv,或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应用程序(可以从苹果应用商店免费获得,但您需要一个帐户),您还需要xcode的可选命令行工具(也可以从应用商店获得)。

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 something installed on it via Ports. I am currently paused at 10.9.5 and am running:

我编写这个答案的系统曾经运行过Snow Leopard,我至少有Ruby 1.9通过端口在其上安装了一些东西。我现在暂停到10.9.5,正在运行:

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

Without any problems.

没有任何问题。

#4


2  

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)"