I have created a demo application in rails 3.2.9
and ruby versiion 2.0.0
. After scaffolding Blog model I am trying to migrate it, but having following
I had this problem too (mysql 0.3.21 and Rails 3.2.22.5). I fixed it by adding a file in my application config/initializers/mysql2_adapter.rb (as there was no such file before)
Added below contents,
require 'active_record/connection_adapters/mysql2_adapter' class ActiveRecord::ConnectionAdapters::Mysql2Adapter NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY" end
and then, in my environment.rb file added below contents,
require File.expand_path('../initializers/mysql2_adapter', FILE)
And it worked.