Can I update to Ruby 2.1.2 using Rails 3.2.3?
Asked Answered
K

2

23

First of all, I think it isn't a prohibited question on StackOverflow since it's a precise question about environment, an objective question. But if it's prohibited, please tell me.

Currently I'm developing a specific project that is using Ruby 1.9.3 and Rails 3.2.3, at the moment we can't upgrade to Rails 4 because the project dependencies.

My question is:

Using Rails 3.2.3, we can upgrade to a newest Ruby version? If so, what version: Ruby 2.0, Ruby 2.1.2 or another one?


Also, I searched on Google and StackOverflow and I don't find a question like that.

Thanks!

Knobby answered 6/8, 2014 at 14:41 Comment(5)
I am looking up your answer, but first note that the latest version of Rails 3.2 is 3.2.19. (Rails 3.2.3 is not supported.)Tafoya
This is strange, really. Screenshot taken from my Terminal: s16.postimg.org/t5bv1yng5/…Knobby
I think your question is 'too localized' for Stack Overflow (it will be obsolete in a year or so) so you might want to edit it to be more general. Maybe this will work: 'How do I choose a compatible Ruby version for a gem, such as Rails?'Tafoya
Such a question was asked in 2012. However the answers are starting to become dated: #9087616Tafoya
I posted a more general answer at the 2012 question https://mcmap.net/q/210188/-which-ruby-on-rails-is-compatible-with-which-ruby-versionTafoya
I
28

The first release of rails that officially support ruby 2.0 was 3.2.13 (see the announcement on the rails blog.

I deployed several applications running 3.2.15-3.2.17 and ruby 2.0 (They've since been upgraded to rails 4) without any problems that I recall.

The recently released 3.2.22 supports ruby 2.2 (announcement)

Illiterate answered 6/8, 2014 at 16:21 Comment(6)
Just a short question: why Rails 3.2.13 ~ 3.2.19 come after "3.2.3" (my Rails version)?Knobby
why? other than because 19 > 3 ?Illiterate
Wow, makes sense, very Rails, much Ruby. I thought it wanted to mean something like 3.2.1.3 or 3.2.1.9. :PKnobby
That version numbering follows a pattern of majorversion.minorversion.patchnumber but I don't blame you for being confused. First a link to a standard, and then to a Wikipedia article about real life semver.org/spec/v2.0.0.html en.wikipedia.org/wiki/Software_versioningTafoya
So all patch versions of Ruby 2.2.x are safe, including Ruby 2.2.3?Polyunsaturated
I believe so - 2.2.x should not introduce any regressions over 2.2.0Illiterate
T
2

According to the Travis configuration, Rails 3.2.3 was only tested with Ruby 1.8.7, 1.9.2 and 1.9.3, so it doesn't seem to be a good idea to use a later version of Ruby (but you can always test it yourself.) However, Rails 3.2.3 has some known security vulnerabilities that have been patched in 3.2.19.

On the other hand, the configuration for Rails 3.2.19 does suggest that the developers expect it to work with Ruby 2.0.0. Your project might benefit from investing some effort to see if you can upgrade from Rails 3.2.3 to 3.2.19, and test a combination of that with Ruby 2.0 for your application, if there are new Ruby features that you need and cannot efficiently backport them. Bear in mind that the only recent answer to a similar question warns of 'weird issues' from such a combination. Also consider that the latest Rails 3.2 release notes do not mention Ruby 2.0.

Tafoya answered 6/8, 2014 at 15:5 Comment(3)
I used to run a rails 3.2 app on 2.0.0. I don't think it was 2.0.0 safe until about 3.2.13 or so.Illiterate
@FrederickCheung please post your comment as an answer. It is better informed than mine.Tafoya
perfect answer :) I was guided here by Google trying to find out if 3.2.22 supports Ruby 2.3 and looking at github.com/rails/rails/blob/v3.2.22.2/.travis.yml I quickly figured out myself that 2.2 is the best choice.Unequal

© 2022 - 2024 — McMap. All rights reserved.