Thursday, July 15, 2010

Rails on Debian

Ran into a strange issue while debugging a Rails app that I am working on. I finally found the exact problem and issue here

Turns out that
the error comes from an incompatibility between Ruby 1.8.7 and Rails 2.0.2. Ruby 1.8.7 has String#chars and returns an Enumerator object, but Rails 2.0.2 expects an ActiveSupport::Multibyte::Chars object.
Which is pointed out here

Putting this in your environment.rb fixes the issue
unless '1.9'.respond_to?(:force_encoding)
  String.class_eval do
      remove_method :chars
    rescue NameError
      # OK

No comments: