title: Rails: Per-environment initializers?
body: <p>I'd like the code in one of my initializers (in <code>config/initializers/</code>) to be run only for the <code>:development</code> environment, but not <code>:test</code> or <code>:production</code>.  What's the best way to do that?</p>
  
  <p>Pasting it into <code>config/environments/test.rb</code> seems unclean, and I don't quite like wrapping the entire initializer file in an <code>if Rails.env == 'development' do ... end</code> statement.  Is there some canonical way to do this?</p>
  
  <p>(Background: To speed up test load times, I'm trying to move the Barista gem into the <code>:development</code> group of my <code>Gemfile</code>, but <code>config/initializers/barista_config.rb</code> calls <code>Barista.configure</code>, so now it chokes on that in test (and production) mode.)</p>