Migration to Ruby 1.9.1

Today I migrated one of my apps to Ruby 1.9.1. Just for fun. It actually went quite well. There were a couple of issues, most of them related to old gems. After getting everything up-to-date though two issues remained.

Rspec-rails would bomb with this error:

undefined method `root’ for Spec::Rails:Module

This turns out to be an issue with constant lookup in Ruby 1.9.1. To get to the (top level) Rails object inside rspec-rails I needed to prefix that with two colons. Easily fixed.

The second was a warning about string transliteration:

Ruby 1.9 doesn’t support Unicode normalization yet

This turned out to be a warning for the combination of Rails 2.3 and Ruby 1.9. I am fine with transliteration missing, so I added an initializer to get rid of the message.