MySQL "Closed Stream"

I have an app that is giving a “closed stream” error when I reload a view or visit it a second time. Typically the page loads fine the first time, but then it fails. It is working fine on another machine. I’m running Rails 2.3.3, Ruby 1.8.7.

blade_settings.rb:8 calls a named_scope at entity.rb:14. Even after removing the named scope and explicitly getting an object for testing, the same error still occurs.

The stack:

/usr/local/lib/ruby/1.8/mysql.rb:1032:in `sync='
/usr/local/lib/ruby/1.8/mysql.rb:1032:in `write'
/usr/local/lib/ruby/1.8/mysql.rb:1092:in `finalizer'
/usr/local/lib/ruby/1.8/mysql.rb:578:in `call'
/usr/local/lib/ruby/1.8/mysql.rb:578:in `start'
/usr/local/lib/ruby/1.8/mysql.rb:578:in `free'
/Users/chris/Workspace/RedPhone/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:468:in `columns'
/Users/chris/Workspace/RedPhone/vendor/rails/activerecord/lib/active_record/base.rb:1275:in `columns_without_redhillonrails_core'
/Users/chris/Workspace/RedPhone/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/base.rb:25:in `columns'
/Users/chris/Workspace/RedPhone/vendor/rails/activerecord/lib/active_record/base.rb:1288:in `column_names'
/Users/chris/Workspace/RedPhone/vendor/rails/activerecord/lib/active_record/base.rb:1301:in `column_methods_hash'
/Users/chris/Workspace/RedPhone/vendor/rails/activerecord/lib/active_record/base.rb:1990:in `all_attributes_exists?'
/Users/chris/Workspace/RedPhone/vendor/rails/activesupport/lib/active_support/dependencies.rb:380:in `all?'
/Users/chris/Workspace/RedPhone/vendor/rails/activerecord/lib/active_record/base.rb:1990:in `each'
/Users/chris/Workspace/RedPhone/vendor/rails/activerecord/lib/active_record/base.rb:1990:in `all?'
/Users/chris/Workspace/RedPhone/vendor/rails/activerecord/lib/active_record/base.rb:1990:in `all_attributes_exists?'
/Users/chris/Workspace/RedPhone/vendor/rails/activerecord/lib/active_record/base.rb:1846:in `method_missing'
/Users/chris/Workspace/RedPhone/app/models/entity.rb:14
/Users/chris/Workspace/RedPhone/app/models/blade_settings.rb:8:in `blade'
/Users/chris/Workspace/RedPhone/app/helpers/layout_helper.rb:17:in `nav_menu'
/Users/chris/Workspace/RedPhone/app/views/layouts/application.html.erb:22:in `_run_erb_app47views47layouts47application46html46erb'

Did you find an answer to this?

I have never seen this issue, but started to get it now after
upgrading to Snow Leopard and 64-bits MySQL. I have recompiled the
mysql gem to 64-bits also.

BR
MartOn