Hi --
I was trying out trunk Ruby 1.9 and edge Rails, and came across the
issue that both 1.9 and ActiveSupport define String#chars. I don't
think I'm the first to notice but I did get caught on it:
$./script/console
Loading development environment (Rails 2.1.0)
>> puts "hi"
/usr/local/lib/ruby-1.9/lib/ruby/1.9.0/irb/ruby-lex.rb:191:in
`buf_input': undefined method `to_a' for "puts \"hi\"\n":String
(NoMethodError)
The problem is that irb is using String#chars, and expects it to
return an enumerator, but ActiveSupport has overridden it so that it
returns a (proxy to a) string. ActiveSupport removes the original
String#chars, like this:
module Unicode
def self.append_features(base)
if '1.8.7 and later'.respond_to?(:chars)
base.class_eval { remove_method :chars }
end
and the defines a new version. Hence the blow-up in the console
session.
I'm not seeing any solution other than changing the name of the
method. Is there another way anyone can see?
David
--
Rails training from David A. Black and Ruby Power and Light:
Intro to Ruby on Rails January 12-15 Fort Lauderdale, FL
Advancing with Rails January 19-22 Fort Lauderdale, FL *
* Co-taught with Patrick Ewing!
See http://www.rubypal.com for details and updates!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---