Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7778105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:18:48+00:00 2026-06-01T18:18:48+00:00

I have this in lib/tasks/foo.rake : Rake::Task[assets:precompile].enhance do print >>>>>>>> hello from precompile end

  • 0

I have this in lib/tasks/foo.rake:

Rake::Task["assets:precompile"].enhance do
  print ">>>>>>>> hello from precompile"
end
Rake::Task["assets:precompile:nondigest"].enhance do
  print ">>>>>>>> hello from precompile:nondigest"
end

When I run rake assets:precompile locally, both messages are printed.

When I push to heroku, only the nondigest message is printed. However, according to the buildpack, the push is executing the exact same command as I am locally.

Why does the enhancement to the base assets:precompile case not work on heroku but does work locally?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T18:18:51+00:00Added an answer on June 1, 2026 at 6:18 pm

    i’ve been looking into this issue and I found out that the behavior of the assets:precompile depending on if RAILS_ENV and RAILS_GROUPS are both set or not take a look at this locally.

      # This works
      → bundle exec rake assets:precompile RAILS_ENV=production
      >>>>>>>> hello from precompile:nondigest
      >>>>>>>> hello from precompile
    
      # This works
      → bundle exec rake assets:precompile RAILS_GROUPS=assets
      >>>>>>>> hello from precompile:nondigest
      >>>>>>>> hello from precompile
      →
    
      # This does not work :'(
      → bundle exec rake assets:precompile RAILS_ENV=production RAILS_GROUPS=assets
      >>>>>>>> hello from precompile:nondigest
      →
    

    The problem comes from https://github.com/rails/rails/blob/3-2-stable/actionpack/lib/sprockets/assets.rake in invoke_or_reboot_rake_task method if you replace the Rake::Task[task].invoke line with ruby_rake_task task 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.

    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 assets:precompile:primary or assets:precompile:all and achieve an outcome similar to your desired intent.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rake task that fetches JSON data from an API, parses it,
I install plugin open_id_authentication and have this error: /usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.beta/lib/active_support/dependencies.rb:167:in `require': no such file to
Lets say I have this class in foobar-shared.lib: class FooBar { std::string m_helloWorld; }
So I have this code inside my lib/ folder: class GlobalConfig::SetHelper def self.yes_no_input(configuration) value
When creating gems, I often have a directory structure like this: |--lib |-- helpers.rb
I have .lib file with its header (.h) file. This file have a few
I have a web application that uses a library which resides in TOMCAT_HOME/common/lib. This
I have an awesome trouble with Gem. After executing this command: rm -f /usr/local/lib/ruby/gems/1.9.1/cache/*
WORKING UPDATE to solve this problem, I simply dragged the tasks/facebooker folder into lib
This is the error I'm getting: Task not supported by 'mysql2' /Users/me/.rvm/gems/ruby-1.8.7-p352@project/gems/rails-2.3.8/lib/tasks/databases.rake:380 Here is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.