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

Posted . Visible to the public.

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

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.

Profile picture of Arne Hartherz
Arne Hartherz
Last edit
License
Source code in this card is licensed under the MIT License.
Posted by Arne Hartherz to makandra dev (2013-02-22 13:43)