-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Info about precompile assets on Heroku with custom config #34
Comments
Thanks for posting this! Helped me out big time! |
Hi @wyaeld, Added a link here in the README. Thanks! |
The explanation here is unclear.
Adding the code on top to |
Hi Eddie, sorry it wasn't clear enough. The way that Heroku interacts with the assets pipeline means the compile step is actually happening before the app is aware that its it production, so as you will have noticed, adding it to the production.rb isn't enough. Your solution is correct, its in my config/application.rb Unfortunately we might need an alternative for Rails4. According to Ryan here |
Thanks for posting! Works great. I'm using handlebars with ember right now, so I had to add one more line: |
Hi Les, it turns out the quirks of the assets precompile stage on Heroku can make things a little tricky if you are using HandlebarsAssets to customize the compiler. I thought I'd share the findings, and maybe you could include a note in the docs to make life easier for others.
This is not a bug of any sort, just sharing info gained.
The issue is while in "development" putting the following in an initialiser or config
works perfectly fine, but they won't compile that way on Heroku if you aren't precompiling prior to pushing, because Heroku's compile step runs prior, and usually most people have
and HandlebarsAssets is usually in the "assets" group in Gemfile, so not available in Production
My solution is to add a form of the following:
Now assets:precompile under every scenario I've encountered compiles with the custom options. Hope this is useful.
The text was updated successfully, but these errors were encountered: