There's a bug in ActiveRecord that causes it to completely break down and cry if a MySQL connection stays idle for too long and gets disconnected by the server.
To fix it, you just have to set auto_reconnect=true in my.cnf, or set the option when you connect to the DB.
In the Ruby MySQL bindings, you can use the options() method on a Mysql class instance:
instance.options("auto_reconnect", true)
