I have in my initializers/my_initializer.rb
:
ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::NATIVE_DATABASE_TYPES[:string] = {
name: 'varchar',
limit: 191
}
Why does it throw the error: uninitialized constant ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter (NameError)
when I try to start the server?
I get the same error even if I put the following in the 1st line of the initializer:
require 'active_record'
However, when I put the below statement in the 1st line of the initializer, everything works fine:
require '/home/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb'
Why does it not work with require 'active_record'
?