MySQL server has gone away with Rails, Sunspot and Cucumber

When using Rails, sunspot and cucumber with a mysql test database, I received the following the MySQL server has gone away error.
After some googling a came across the `reconnect` option for database config

1
2
3
4
Using the default profile...
Sunspot server is starting...
Sunspot server took 2.72 sec. to get up and running. Let's cuke!
Mysql::Error: MySQL server has gone away: SHOW TABLES (ActiveRecord::StatementInvalid)

Solution is to add

1
reconnect: true

to cucumber section of your database.yml

Thanks to: http://rywalker.com/