How do you catch errors in the rails asset pipeline before production? -


I'm just getting acquainted with Rail 3.1, and I burned some time to update an old project and it Tried to know how the new property develops pipeline production mode vs.

The default config.assets.precompile setting only application.css and blesses the application JS , the same stylesheet And everything should be served as a javascript file.

Obviously such situations happen when we do not want to do this, so we can add items to that configuration variable list ...

When I go to production my sandbox Status of the project running with me:

  1. Look at the site in development, seeing that everything is working. Assets were added as separate files and the site was displayed correctly.
  2. The site was uploaded to my server, and it tried to work in production. The first error was saying that "ie.css" (a conditional stylesheet) is not precompiled. (I was in Safari and this stylesheet will also not be downloaded: An error was encountered with the stylesheet_link_tag assistant before rendering the page.)
  3. rank rake assets:
  4. Adding objectionable items to config.assets.precompile and tried again.
  5. Hold down the error until it can suppress any other asset error.
  6. It does not know how to know, many times I went around in the circle until I thought that I was rendering in property and site production it was done. Then I tried to do it in MSIE and hit another error 500: "belated_png_fix.js" was being conditionally loaded, and till then did not crop.

    So my question is, apart from the huge reliance on trial and error or integration testing, how can I predict that my site is not being divided when the asset pipeline shows that some stylesheet or Was not javascript added to the precompile list?

    I am also worried that due to a missing stylesheet asset, the whole page should require error instead of demanding 500 or instead of giving 404 service, when that property is requested. Is it a deliberate design for "initial failure"?

    I have just released a gem, which ensures that the developers config Assets.precompile , while they are developing. If you include an asset through javascript_include_tag or stylesheet_link_tag , this will be an exception, and it does not match one filter in config.assets.precompile .

    This means that instead of searching after production deployment, asset errors will be caught during the development.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -