title: How do you catch errors in the rails asset pipeline before production?
body: <p>I'm just getting acquainted with Rails 3.1, and I burned some time updating an old project and trying to work out how the new asset pipeline behaves in development mode versus production.</p>
  
  <p>The default <code>config.assets.precompile</code> setting blesses only <strong>application.css</strong> and <strong>application.js</strong>, with the intention that everything should be served as a single stylesheet and a single javascript file.</p>
  
  <p>Obviously there are situations when we don't want that, so we can add items to the list in that config variable...</p>
  
  <p>Here's the situation I ran into with my sandbox project when going to production:</p>
  
  <ol>
  <li>Browsed the site in development, saw that everything was working. The assets were linked as separate files and the site displayed correctly.</li>
  <li>Uploaded the site to my server, and tried to get it working in production. The first error was saying that <em>"ie.css"</em> (a conditional stylesheet) isn't precompiled. (I was in Safari and this stylesheet wouldn't even be downloaded: the error was raised from the <code>stylesheet_link_tag</code> helper before rendering the page.)</li>
  <li>Ran <code>rake assets:precompile</code> and tried again.</li>
  <li>Added the offending item to <code>config.assets.precompile</code> and tried again.</li>
  <li>Kicked the error down the curb until it hit another asset error.</li>
  <li>GOTO 3.</li>
  </ol>
  
  <p>Not knowing how to address this, I went around in circles a few times until I thought I got all the assets and the site was rendering in production. Then I tried it in MSIE and hit another error 500: <em>"belated_png_fix.js"</em> was being conditionally loaded, and it didn't crop up until then.</p>
  
  <p>So my question is, other than trial and error or a heavy dependence on integration testing, how can I predict that my site isn't going to bomb out when the asset pipeline discovers that some stylesheet or javascript wasn't added to the precompile list?</p>
  
  <p>I'm also curious why a missing stylesheet asset should cause the whole page to error 500 instead of just compiling it on-demand or serving a 404 when that asset is requested. Is this a deliberate design to "fail early"?</p>