2

When I do heroku rake assets:precompile this takes almost 15 minutes everytime I do this and it's taking too long.

I am using asset_sync with heroku with S3 but is there a way to speed up this process?

Passionate Engineer
  • 10,034
  • 26
  • 96
  • 168
  • what about running rake assets:precompile RAILS_ENV=production ? works for me when running my app on heroku, just ensure your heroku app has all your S3 credentials? – Richlewis Mar 27 '14 at 15:59
  • Did you find an acceptable solution for this? I'm running into this same issue. – helloJello Feb 25 '15 at 06:25

1 Answers1

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 !)

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.

Doug
  • 14,387
  • 17
  • 74
  • 104