Forum: Ruby on Rails SerializationTypeMismatch in Production Mode

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
unknown (Guest)
on 2007-02-19 00:12
(Received via mailing list)
In production mode, I keep getting this error the 2nd time it loads a
page with a serialized attribute:

ActiveRecord::SerializationTypeMismatch (answers_container was
supposed to be a Array, but was a NilClass):

In development, it works fine. In fact, if I set to false
config.cache_classes in production.rb, it works fine.

The first time you hit the page, it works fine. Upon refresh, it
returns that error.

This happens with both webbrick and litespeed.

The controller code is:

def new
    if request.env["HTTP_REFERER"]
      params[:my_id] = "survey" if
request.env["HTTP_REFERER"].include? "survey"
    @question =
    @question.answers_container =, "")
    @question.creator_message = current_user[:note] if logged_in?

In my model, I define the serialized attribute as such:
serialize :answers_container, Array

I was running rails 1.2, then upgraded to 1.2.2 after seeing I have
this problem. I believe when I was running 1.1.6 I did not have this

Does anyone have any suggestions?

Carl L. (Guest)
on 2007-02-19 02:59
(Received via mailing list)
What databases are you using (mysql? postgres?, ...) ? Are they
different in development and production?


On 2/18/07, removed_email_address@domain.invalid 
<removed_email_address@domain.invalid> wrote:
> config.cache_classes in production.rb, it works fine.
>     if request.env["HTTP_REFERER"]
> >

EPA Rating: 3000 Lines of Code / Gallon (of coffee)
unknown (Guest)
on 2007-02-19 03:17
(Received via mailing list)
Both mysql. Everything is the same. In fact, on my local machine, both
production and development databases use the same mysql database.
This topic is locked and can not be replied to.