How can I run SOME initializers when doing a Rails assets:precompile?

前端 未结 5 1844
無奈伤痛
無奈伤痛 2021-02-04 03:55

Background

I have an app that I recently updated to Rails 3.2.1 (from Rails 3.0.x) and have refactored the JS and CSS assets to make use of the new asset pipeline. Th

5条回答
  •  故里飘歌
    2021-02-04 04:14

    Although your intializer is not run when the assets are precompiling, you should still find that they run as Rails boors up as normal, however, this will be on the first hit to the application rather than at the deploy step.

    I'm not entirely sure what the issue you're having is, but if you follow the Rails conventions the deploy will work as expected.

提交回复
热议问题