Search code examples
ruby-on-railsruby

Which Ruby on Rails is compatible with which Ruby version?


I have an old 2.1.1 Ruby on Rails application, with the system upgraded to use Ruby 1.8.7. It originally used 1.8.5 or so.

I want to upgrade it to Ruby 1.9.x for performance reasons, and possibly to a newer Ruby on Rails as well.

I cannot find any easy chart of compatibility between different Ruby versions and Ruby on Rails versions.

Will 2.1.1 work with Ruby 1.9.x? If not, how far do I need to upgrade it first, and what kind of issues am I likely to encounter? My application does complicated things to database layer, but the rest is fairly straightforward.


Solution

  • This is an old question, but the fact that rails is tested against a version of ruby is a good indication that it should work on that version of ruby.

    The required ruby version in the gemspec file will at least give you an official answer for the minimum version of run. Taking that information, pls the version of Buildkite used for automated testing, on older versions, gives the following results:

    Rails 7.2

    • >= 3.1.0

    Rails 7.1

    • >= 2.7.0

    Rails 7.0

    • >= 2.7.0

    Rails 6.1

    • >= 2.5.0

    Rails 6.0

    • >= 2.5.0

    Rails 5.2

    Rails 5.1

    • >= 2.2.2

    Rails 5.0

    • >= 2.2.2

    Rails 4.2

    • >= 1.9.3

    Rails 4.1

    • >= 1.9.3

    Prior to 9th April 2019, stable branches of Rails since 3.0 use travis-ci for automated testing, and the list of tested ruby versions, by rails branch, is:

    Rails 3.0

    • 1.8.7
    • 1.9.2
    • 1.9.3

    Rails 3.1

    • 1.8.7
    • 1.9.2
    • 1.9.3

    Rails 3.2

    • 1.8.7
    • 1.9.2
    • 1.9.3
    • 2.0.0
    • 2.1.8
    • 2.2.6
    • 2.3.3

    Rails 4.0

    • 1.9.3
    • 2.0.0
    • 2.1
    • 2.2

    Rails 4.1

    • 1.9.3
    • 2.0.0
    • 2.1
    • 2.2.4
    • 2.3.0

    Rails 4.2

    • 1.9.3
    • 2.0.0-p648
    • 2.1.10
    • 2.2.10
    • 2.3.8
    • 2.4.5

    Rails 5.0

    • 2.2.10
    • 2.3.8
    • 2.4.5

    Rails 5.1

    • 2.2.10
    • 2.3.7
    • 2.4.4
    • 2.5.1

    Rails 5.2

    • 2.2.10
    • 2.3.7
    • 2.4.4
    • 2.5.1

    Rails 6.0

    • 2.5.3
    • 2.6.0

    (From https://www.hmallett.co.uk/2018/08/ruby-and-ruby-on-rails-version-compatibility/)