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

4

69

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

Winger answered 24/11, 2015 at 0:54 Comment(2)
rvm is well worth the effort, especially if you are going to maintain more than one rails project. it's not a big install, and will make your ruby-using life much easier in the long termSemiautomatic
Both RVM and rbenv are able to make your life easier. If you're able to run OS X 10.6.8, you have enough horsepower to run Ruby and the compiler and command-line tools. It won't run as fast as it will on current systems, but for learning and development it should be fine.Highclass
I
144

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
Indenture answered 24/11, 2015 at 1:0 Comment(9)
But do I need the latest version of OS X (10.10)? Will this work with my OS X version, 10.6.8?Winger
I STRONGLY recommend reading the entire RVM installation page. Repeatedly, we see questions on SO from people who haven't taken the time to understand how RVM works or how to troubleshoot it.Highclass
I get this error: : Requirements installation failed with status: 1. .rvm/bin/rvm: line 66: shell_session_update: command not found bash: line 847: shell_session_update: command not foundDubois
@Dubois Try this.Hyperostosis
This requires homebrew and it already has new version of rubySnatch
@theTinMan RTFM doesn't work for everyone. If I'd had to read all documentation for everything I use I'd never get anything done!Photostat
This is a good option BUT if you already have brew, it does the job as well ;)Chinchilla
@RoyCalderon Why don't you post an answer for brew ;)Huddleston
restarting the terminal or source ~/.rvm/scripts/rvm is the key.Bury
T
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.

Talley answered 15/7, 2016 at 18:52 Comment(1)
0 down vote It worked for me: - First I´ve installed Homewbrew with: /usr/bin/ruby -e "$(curl -fsSL raw.githubusercontent.com/Homebrew/install/master/install)" (DO NOT use sudo for this step!!) verify the install with : brew -v verify your Ruby install with : ruby -v install sass with gem install sass verify gem with: sass --version and finally do: rvm list known Now I have: laomusics-mbp% ruby -v ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin10.0] in a OSX 1068, MBP.Hope this helps others !Adam
P
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.

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.

Pentheus answered 24/11, 2015 at 3:6 Comment(2)
Thanks. Your answer is a little over my head, but I appreciate it.Winger
You can look at macports.org or brew.sh if you want to update your system ruby. If going with a version manger I would suggest RVM as that seems to have more traction in the Ruby community.. See rvm.io. Myself, before I gave up on version managers altogether, I switched to rbenv as a less intrusive option. See github.com/sstephenson/rbenv. Both have very active teams and both teams are exceptionally helpful, or so I have found.Pentheus
I
2

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)"
Imtiaz answered 3/3, 2017 at 20:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.