Read more

Upgrading a Rails 3.2 application to Ruby 2.1 is really easy

Henning Koch
November 19, 2014Software engineer at makandra GmbH

Upgrading from Ruby 1.8.7 to 2.1.2 took me an hour for a medium-sized application. It involved hardly any changes except

  • removing the occasional monkey patch where I had backported functionality from modern Rubies
  • Migrating from require to require_relative where I loaded RSpec factories in Cucumber's env.rb (the Rails application root is no longer in the load path by default)
  • replacing the old debugger with byebug
  • removing sytem_timer from Gemfile (see this SO thread Show archive.org snapshot for details)
  • If you get LoadError: cannot load such file -- iconv: Add gem 'iconv' to your Gemfile. iconv is a part of Ruby that was removed in 2.0. Rails 3 seems to depend on it.
Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

All the pain with magic # encoding: utf-8 comments is gone since UTF-8 is a default encoding in Ruby 2+.

Posted by Henning Koch to makandra dev (2014-11-19 08:44)