can't run: rake gems:install if application.rb depends on initializers

I'm updating an app and wanted to install rspec.

After installing the gem into the system I added:

   config.gem "rspec-rails", :lib => "spec"

to config/environment.rb and ran:

   rake gems:install

However the install does not complete because my initializer is not run.

In my initializer I defined a constant: EXCEPTION_NOTIFIER_CONFIGS_EXISTS that is used in application.rb.

Changing the code in application.rb to this works:

     include ExceptionNotifiable

In general a task that installs a gem shouldn't need to rely on much.

Threads that partially relate to to this are here:

   Initializers aren't run on gem dependency failure

   missing config.gem

However I am not trying to deal with optional gems or continue my application with missing gems -- just trying to install a gem into vendor/gems.