Ruby 1.8.7 & rails 2.0.2

If you do string.last or string.first it fails in access.rb line 43 I
found the answer on another mailing list.

Ruby 1.8.7 has String#chars.
It returns an Enumerator object
but Rails 2.0.2 expects an ActiveSupport::Multibyte::Chars object.

You can avoid this conflict by putting
the following code in config/initializers/ directory.


unless ‘1.9’.respond_to?(:force_encoding)
String.class_eval do
begin
remove_method :chars
rescue NameError
# OK
end
end
end

Note: activesupport/lib/active_support/core_ext/string/unicode.rb
of Rails 2.1.0 removes “chars” method from String class of Ruby 1.8.7.