```ruby
require 'rails'
require 'erd/engine'


module Erd
  autoload :Migrator, 'erd/migrator'

  class Railtie < ::Rails::Railtie #:nodoc:
    initializer 'erd' do |app|
      ActiveSupport.on_load(:after_initialize) do
        if Rails.env.development?
          Rails.application.routes.append do
            mount Erd::Engine, :at => '/erd'
          end
        end
      end
    end
  end
end
```

Initialize the routes a bit earlier (after_initialize => to_prepare)
user
```ruby
require 'rails'
require 'erd/engine'


module Erd
  autoload :Migrator, 'erd/migrator'

  class Railtie < ::Rails::Railtie #:nodoc:
    config.to_prepare do
      if Rails.env.development?
        Rails.application.routes.append do
          mount Erd::Engine, :at => '/erd'
        end
      end
    end
  end
end
```
assistant