title: In what order are the config files loaded for Rails?
body: <p>I'm in the process of trying to initialize different gems for different environments. I'm using initializer config files (for things like Paperclip) and environment config files (for my dev, test, qa, prod environments).</p>
  
  <p>For some context, I'm trying to get my prod and qa servers to use S3 storage for Paperclip, but use local storage with different directories for dev and test. I have no idea in what order these config files are loaded. </p>
  
  <p>I was wondering if someone could shed some light on the load order so that I can make sure I've got any dependencies or overrides correct. Also, I just like to know how these things work.</p>
  
  <p>I'm particularly interested in the directories/files listed below</p>
  
  <pre><code>config/
      environments/
          develop.rb
          test.rb
          ...env-specific config files
  
  
      initializers/
          paperclip.rb
          ...gem-specific config files
  
      application.rb
      boot.rb
      deploy.rb
      environment.rb
      routes.rb
  </code></pre>
  
  <p>Thanks!</p>