Exclude an environment configuration from rake execution?

On my rails project I have config/environments/development.rb with the
following configuration:

config.after_initialize do
    puts '=> Abc Loader Initialized'

I need this here so it can be executed on the startup of the

However, everytime I execute a rake task on the application, this code
is also executed. Is there a way to exclude this code from rake tasks?