This error appears constantly, in my case, I installed ruby, gems, rails, mysql2 all right. But when I tried:
rake db:create
Another error appeared:
Gem :: LoadError: Specified 'mysql2' for database adapter, but the gem is not loaded. Add gem 'mysql2'
to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
Gem :: LoadError: can not activate mysql2 (~> 0.3.13), already activated mysql2-0.4.0. Make sure all dependencies are added to Gemfile.
In this case, any attempt I attempted to generate error, the solution I found was, access the Gemfile and change to:
# Use mysql as the database for Active Record
gem 'mysql2', '~> 0.3.13'
I saved and executed:
bundle exec rake db:create
I love you!
I hope I can help someone else with this post.