rake assets:precompile is slow

后端 未结 3 1948
太阳男子
太阳男子 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 05:09

    There is a bug in Rails 3.1.0 that includes too many files in the precompile process. This could be the reason for the slowness if you have many assets js and css assets.

    The other is that Sprockets (the gem doing the compilation) is more complex and has to allow for more options - scss, coffeescript and erb. Because of this I suspect it will be slower doing just concatenation and minification.

    As suggested, you could precompile the files before deploying them if this is still an issue.

提交回复
热议问题