Posted over 3 years ago. Visible to the public.

Upgrade from Ruby 1.8.7 to 2.1.5 – an incomplete guide

I recommend to go straight to 2.1.5+ without intermediate steps. Otherwhise you burden yourself with unnecessary work of encoding problems.

Issues you may encounter:

  • Set the ruby version within your .ruby-version file to 2.1.5
  • Remove gem ruby-debug and use e.g. byebug
  • Remove gem oniguruma
  • Remove gem fastercsv
  • Replace gem mysql with mysql2
  • Update gem capistrano 2.12.0 to ~>2.12 when bound for Ruby 1.8.7 and remove obsolete explicite Gemfile entries for net-scp and net-ssh if present.
  • Update gem andand
  • Update gem parallel_tests (0.8.x to 1.6.x)
  • Downdgrade database_cleaner from 1.4.x to 1.2.0
  • Use new lambda syntax: change lambda { |param| code } to ->(param) { code }
  • Unbind gem 'i18n', '~> 0.6.0' and update
  • fix yml erros:
    • %{count} errors by surrounding with ", e.g.: replace one: %{count} Objekt with one: "%{count} Objekte"
    • date: order: [ :day, :month, :year ] to

      Copy
      date: order: - :year - :month - :day
  • fix incompatible character encodings: UTF-8 and ASCII-8BIT error by adding

    Copy
    Encoding.default_external = Encoding::UTF_8 Encoding.default_internal = Encoding::UTF_8

    to environment.rb before Appname::Application.initialize!

  • use ' ' for nbsp helper instead of 0xC2.chr + 0xA0.chr
  • TextHelper#truncate changed signature from (string, int) to (string, length: int)
  • You may update gem sanitize from 2.x to 4+
  • In regexes \w does not match umlauts and other special characters. If it is supposed to you can use [[:alnum:]] instead.

Once an application no longer requires constant development, it needs periodic maintenance for stable and secure operation. makandra offers monthly maintenance contracts that let you focus on your business while we make sure the lights stay on.

Owner of this card:

Avatar
Martin Straub
Last edit:
23 days ago
by Tobias Kraze
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Martin Straub to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more