rake assets:precompile is slow

后端 未结 3 1951
太阳男子
太阳男子 2020-12-15 04:36

The command \"rake assets:precompile\" works very slow for me. Especially on my Amazon EC2 Micro production server which does not have a lot of processor resources. On EC2 I

3条回答
  •  温柔的废话
    2020-12-15 04:49

    If you don't need to load the Rails environment, you should disable that with:

    config.assets.initialize_on_precompile = false
    

    EDIT: I've just written a gem to solve this problem, called turbo-sprockets-rails3. It speeds up your assets:precompile by only recompiling changed files, and only compiling once to generate all assets.

    It would be awesome if you could help me test out the turbo-sprockets-rails3 gem, and let me know if you have any problems.

提交回复
热议问题