Refactor to use require. Move rubygems setup to a new module.
Add a sleep of 3 seconds before try to authenticate on mysql.