if you getting errors with your mysql gem in ruby on rails 4 you need to fix your Gemfile like this:

gem 'mysql2' ~> '0.3.18'

this downgrades mysql2 gem to 0.3.18 version