Read more

How to silence UTF-8 warnings on Rails 2.3 with Ruby 1.9

Arne Hartherz
February 22, 2013Software engineer at makandra GmbH

Rails 2.3.16+ on Ruby 1.9 causes warnings like this:

.../gems/activesupport-2.3.17/lib/active_support/core_ext/string/output_safety.rb:22: warning: regexp match /.../n against to UTF-8 string
Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

Many thanks to grosser for supplying a monkey-patch for Rails 2.3 Show archive.org snapshot (Commit f93e3f0ec3 Show archive.org snapshot fixed it for Rails 3). Just put it into config/initializers/ to make those warnings go away.

Since we're using RSpec on most projects, I've transformed the test for it to a spec. See the attached link.

Posted by Arne Hartherz to makandra dev (2013-02-22 14:43)