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

RubyMacosTerminal

Ruby Problem Overview


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.

I also found "https://stackoverflow.com/questions/3696564/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.

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]'.

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

Ruby Solutions


Solution 1 - Ruby

I suggest that you use RVM to install Ruby.

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

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

rvm install 2.2
rvm use 2.2 --default

Solution 2 - Ruby

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.

Solution 3 - Ruby

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.

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.

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

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.

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:

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

Without any problems.

Solution 4 - Ruby

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

Use this:

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser70848View Question on Stackoverflow
Solution 1 - RubyLinus OleanderView Answer on Stackoverflow
Solution 2 - RubyHoratioView Answer on Stackoverflow
Solution 3 - RubyJames B. ByrneView Answer on Stackoverflow
Solution 4 - RubyPaula HasstenteufelView Answer on Stackoverflow