When I do heroku rake assets:precompile
this takes almost 15 minutes everytime I do this and it's taking too long.
当我执行heroku rake资产时:预编译每次执行此操作需要将近15分钟,而且耗时太长。
I am using asset_sync with heroku with S3 but is there a way to speed up this process?
我正在使用带有heroku的asset_sync和S3,但有没有办法加快这个过程?
1 个解决方案
#1
0
You can precompile assets locally, which will usually be faster. If you are doing this, make sure you have a pre-commit compile git hook so that you don't forget to precompile on deploy (make sure to use RAILS_ENV=production
!)
您可以在本地预编译资产,这通常会更快。如果你这样做,请确保你有一个预提交编译git钩子,这样你就不会忘记在部署时预编译(确保使用RAILS_ENV = production!)
https://devcenter.heroku.com/articles/rails-asset-pipeline#compiling-assets-locally
If a public/assets/manifest.yml is detected in your app, Heroku will assume you are handling asset compilation yourself and will not attempt to compile your assets. Rails 4 uses a file called public/assets/manifest-.json instead. More recent versuions use public/assets/.sprockets-manifest-.json (note the dot . indicating it may be hidden by default on your machine). On all versions you can generate this file by running $ rake assets:precompile locally and checking the resultant files into Git.
如果在您的应用中检测到public / assets / manifest.yml,Heroku将假定您自己正在处理资产编译,并且不会尝试编译您的资产。 Rails 4使用名为public / assets / manifest-.json的文件。最近的版本使用public / assets / .sprockets-manifest-.json(注意点。表示它可能在您的机器上默认隐藏)。在所有版本上,您可以通过运行$ rake assets来生成此文件:在本地预编译并将生成的文件检入Git。
#1
0
You can precompile assets locally, which will usually be faster. If you are doing this, make sure you have a pre-commit compile git hook so that you don't forget to precompile on deploy (make sure to use RAILS_ENV=production
!)
您可以在本地预编译资产,这通常会更快。如果你这样做,请确保你有一个预提交编译git钩子,这样你就不会忘记在部署时预编译(确保使用RAILS_ENV = production!)
https://devcenter.heroku.com/articles/rails-asset-pipeline#compiling-assets-locally
If a public/assets/manifest.yml is detected in your app, Heroku will assume you are handling asset compilation yourself and will not attempt to compile your assets. Rails 4 uses a file called public/assets/manifest-.json instead. More recent versuions use public/assets/.sprockets-manifest-.json (note the dot . indicating it may be hidden by default on your machine). On all versions you can generate this file by running $ rake assets:precompile locally and checking the resultant files into Git.
如果在您的应用中检测到public / assets / manifest.yml,Heroku将假定您自己正在处理资产编译,并且不会尝试编译您的资产。 Rails 4使用名为public / assets / manifest-.json的文件。最近的版本使用public / assets / .sprockets-manifest-.json(注意点。表示它可能在您的机器上默认隐藏)。在所有版本上,您可以通过运行$ rake assets来生成此文件:在本地预编译并将生成的文件检入Git。