Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>i've been looking into this issue and I found out that the behavior of the <code>assets:precompile</code> depending on if <code>RAILS_ENV</code> and <code>RAILS_GROUPS</code> are both set or not take a look at this locally. </p> <pre><code> # This works → bundle exec rake assets:precompile RAILS_ENV=production &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; hello from precompile:nondigest &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; hello from precompile # This works → bundle exec rake assets:precompile RAILS_GROUPS=assets &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; hello from precompile:nondigest &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; hello from precompile → # This does not work :'( → bundle exec rake assets:precompile RAILS_ENV=production RAILS_GROUPS=assets &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; hello from precompile:nondigest → </code></pre> <p>The problem comes from <a href="https://github.com/rails/rails/blob/3-2-stable/actionpack/lib/sprockets/assets.rake">https://github.com/rails/rails/blob/3-2-stable/actionpack/lib/sprockets/assets.rake</a> in <code>invoke_or_reboot_rake_task</code> method if you replace the <code>Rake::Task[task].invoke</code> line with <code>ruby_rake_task task</code> then it works like you would expect it to. I've been poking around on exactly why this is, and haven't found the reason. </p> <p>Since both variables are set in the Heroku build pack, you could create a custom build pack without setting both GROUP and ENV settings, though I think that is overkill. In this scenario you should be able to enhance <code>assets:precompile:primary</code> or <code>assets:precompile:all</code> and achieve an outcome similar to your desired intent.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload