Hi! I have a class that derives from nothing and is located in /models. I''m using " my string ".chars to manipulate strings that potentially contain special chars and replace them with an US-ASCII equivalent. It did work until yesterday. Now on a linux system "a".chars returns #<Enumerable::Enumerator:0xb74e3d6c> While it should return #<ActiveSupport::Multibyte::Chars:0xb74e1bc0 @string="a"> (the class is contained in active_support/multibyte/chars.rb) Therefore the whole app crashes because Enumerable does not have methods like "downcase" or "''a''.chars[0]" which can handle UTF-8 chars as well. Using it w/o UTF-8 support ends up in a mess. Any ideas? How could I require or include "ActiveSupport::Multibyte::Chars"? Any tests have been negative so far. regards David -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Jun-18 10:31 UTC
Re: How to use Chars in classes not derived from AR
On 18 Jun 2008, at 10:46, David Scheffel wrote:> > Hi! > > I have a class that derives from nothing and is located in /models. > I''m > using " my string ".chars to manipulate strings that potentially > contain > special chars and replace them with an US-ASCII equivalent. > > It did work until yesterday. Now on a linux system "a".chars returns > #<Enumerable::Enumerator:0xb74e3d6c> > > While it should return > #<ActiveSupport::Multibyte::Chars:0xb74e1bc0 @string="a"> >Have you just upgraded to ruby 1.8.7 by any chance? Are you running rails 2.1 ? versions < 2.1 aren''t ready for 1.8.7 IIRC. Fred> (the class is contained in > active_support/multibyte/chars.rb) > > Therefore the whole app crashes because Enumerable does not have > methods > like "downcase" or "''a''.chars[0]" which can handle UTF-8 chars as > well. > Using it w/o UTF-8 support ends up in a mess. > > Any ideas? How could I require or include > "ActiveSupport::Multibyte::Chars"? Any tests have been negative so > far. > > regards > David > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Yes, that''s it. I''ve just checked on another linux server that is running with Ruby 1.8.6.144-2 and a vulnerable openssl version. And it still works there. It might be connected to the different ruby version. I''m trying to downgrade now.> > Have you just upgraded to ruby 1.8.7 by any chance? Are you running > rails 2.1 ? versions < 2.1 aren''t ready for 1.8.7 IIRC. > > Fred-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
This did not solved the problem so far. Any experiences or ideas regarding this issue? Thanks David -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Finally it did. I''ve just forgot to undo the changes I did while I was trying to fix it by myself. k Thanks! Any rumors why this happens that often, or why this particular packages is causing this issue? I''ve already experienced it several times that our rails application was broken after upgrading a gem or rails specific deb-package. Regards David -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---