Paul Welty
2006-Nov-02 13:26 UTC
Inconsistent serialization-getting YAML::Syck object not hash in production on DreamHost
I have a field that''s serialized in my model with "serialize :field". This works fine going back and forth to a hash in Locomotive in development. ''field'' always comes out as a hash. So, in development, I get a YAML::dump like this: !map:HashWithIndifferentAccess key1: "value1" key2: "value2" But, in production on DreamHost, the deseralization ends up like this: !ruby/object:YAML::Syck::DomainType domain: yaml.org,2002 type_id: map:HashWithIndifferentAccess value: key1: "value1" key2: "value2" Thus, of course, I can''t use the hash methods. And Rails then generates errors like "undefined method `include?'' for #<YAML::Syck::DomainType:0x407fb584>". And this, of course, breaks the whole app. I''m using Rails 1.1.6, and so is DreamHost. Does anyone have any ideas What might be going on? -Paul --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
paul.welty-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Nov-10 12:39 UTC
Re: Inconsistent serialization-getting YAML::Syck object not hash in production on DreamHost
Paul Welty wrote:> I have a field that''s serialized in my model with "serialize :field". This > works fine going back and forth to a hash in Locomotive in development. > ''field'' always comes out as a hash. So, in development, I get a YAML::dump > like this: > > !map:HashWithIndifferentAccess > key1: "value1" > key2: "value2" > > But, in production on DreamHost, the deseralization ends up like this: > > !ruby/object:YAML::Syck::DomainType > domain: yaml.org,2002 > type_id: map:HashWithIndifferentAccess > value: > key1: "value1" > key2: "value2" > > Thus, of course, I can''t use the hash methods. And Rails then generates > errors like "undefined method `include?'' for > #<YAML::Syck::DomainType:0x407fb584>". And this, of course, breaks the whole > app. > > I''m using Rails 1.1.6, and so is DreamHost. Does anyone have any ideas > What might be going on? > > -PaulI tried "rake freeze_gems", but that doesn''t have any effect. I checked on DreamHost, and they are using Ruby 1.8.2, but Locomotive uses 1.8.4. Could that be the problem? -Paul --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
paul.welty-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Nov-17 13:54 UTC
Re: Inconsistent serialization-getting YAML::Syck object not hash in production on DreamHost
I realize I''m the only person talking in this thread, but this problem is killing me. I tried installing custom Ruby on DreamHost and using 1.8.4. In fact, I created an entire custom Rails environment. But, nothing makes the slightest difference. So, it seems like there are different YAML::Syck modules on different platforms. Could this be right? If so, shouldn''t someone have run into this problem before? paul.welty-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> Paul Welty wrote: > > I have a field that''s serialized in my model with "serialize :field". This > > works fine going back and forth to a hash in Locomotive in development. > > ''field'' always comes out as a hash. So, in development, I get a YAML::dump > > like this: > > > > !map:HashWithIndifferentAccess > > key1: "value1" > > key2: "value2" > > > > But, in production on DreamHost, the deseralization ends up like this: > > > > !ruby/object:YAML::Syck::DomainType > > domain: yaml.org,2002 > > type_id: map:HashWithIndifferentAccess > > value: > > key1: "value1" > > key2: "value2" > > > > Thus, of course, I can''t use the hash methods. And Rails then generates > > errors like "undefined method `include?'' for > > #<YAML::Syck::DomainType:0x407fb584>". And this, of course, breaks the whole > > app. > > > > I''m using Rails 1.1.6, and so is DreamHost. Does anyone have any ideas > > What might be going on? > > > > -Paul > > I tried "rake freeze_gems", but that doesn''t have any effect. > > I checked on DreamHost, and they are using Ruby 1.8.2, but Locomotive > uses 1.8.4. Could that be the problem? > > -Paul--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jeremy Kemper
2006-Nov-17 14:01 UTC
Re: Inconsistent serialization-getting YAML::Syck object not hash in production on DreamHost
On 11/17/06, paul.welty-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <paul.welty-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I realize I''m the only person talking in this thread, but this problem > is killing me. > > I tried installing custom Ruby on DreamHost and using 1.8.4. In fact, I > created an entire custom Rails environment. But, nothing makes the > slightest difference. > > So, it seems like there are different YAML::Syck modules on different > platforms. Could this be right? > > If so, shouldn''t someone have run into this problem before?Try serializing a Hash instead of a HashWithIndifferentAccess. Then you''ll get compatible YAML across Syck versions. jeremy --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
paul.welty-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Nov-17 15:07 UTC
Re: Inconsistent serialization-getting YAML::Syck object not hash in production on DreamHost
Thanks! That seems to have worked. I never would have guessed that, so I really appreciate it. -Paul --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---