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 7555185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:32:21+00:00 2026-05-30T11:32:21+00:00

I have this Capistrano task: namespace :deploy do task :precompile, :role => :app do

  • 0

I have this Capistrano task:

namespace :deploy do
  task :precompile, :role => :app do
    run "cd #{release_path}/ && RAILS_ENV=staging bundle exec rake assets:precompile --trace"
  end
end

after "deploy:finalize_update", "deploy:precompile"

I know that there’s load 'deploy/assets' but I’m trying to understand what’s going on here.

I’m deploying to a Amazon EC2 m1.small instance, which apparently has constantly 50% cpu steal time, verified with top.
This leads to increased time for compiling assets, but have a look at this:

    [23.21.xxx.xx] rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell 'ruby-1.9.3-p125' -c 'cd /home/ubuntu/apps/myapp-rails/releases/20120227020245/ && RAILS_ENV=staging bundle exec rake assets:precompile --trace'
 ** [out :: 23.21.xxx.xx] ** Invoke assets:precompile (first_time)
 ** [out :: 23.21.xxx.xx] ** Execute assets:precompile
 ** [out :: 23.21.xxx.xx] /home/ubuntu/.rvm/rubies/ruby-1.9.3-p125/bin/ruby /home/ubuntu/apps/myapp-rails/shared/bundle/ruby/1.9.1/bin/rake assets:precompile:all RAILS_ENV=staging RAILS_GROUPS=assets --trace
 ** [out :: 23.21.xxx.xx] ** Invoke assets:precompile:all (first_time)
 ** [out :: 23.21.xxx.xx] ** Execute assets:precompile:all
 ** [out :: 23.21.xxx.xx] ** Invoke assets:precompile:primary (first_time)
 ** [out :: 23.21.xxx.xx] ** Invoke assets:environment (first_time)
 ** [out :: 23.21.xxx.xx] ** Execute assets:environment
 ** [out :: 23.21.xxx.xx] ** Invoke environment (first_time)
 ** [out :: 23.21.xxx.xx] ** Execute environment
 ** [out :: 23.21.xxx.xx] ** Invoke tmp:cache:clear (first_time)
 ** [out :: 23.21.xxx.xx] ** Execute tmp:cache:clear
 ** [out :: 23.21.xxx.xx] ** Execute assets:precompile:primary
 ** [out :: 23.21.xxx.xx] ** Invoke assets:precompile:nondigest (first_time)
 ** [out :: 23.21.xxx.xx] ** Invoke assets:environment (first_time)
 ** [out :: 23.21.xxx.xx] ** Execute assets:environment
 ** [out :: 23.21.xxx.xx] ** Invoke environment (first_time)
 ** [out :: 23.21.xxx.xx] ** Execute environment
 ** [out :: 23.21.xxx.xx] ** Invoke tmp:cache:clear (first_time)
 ** [out :: 23.21.xxx.xx] ** Execute tmp:cache:clear
 ** [out :: 23.21.xxx.xx] ** Execute assets:precompile:nondigest
    command finished in 958131ms

Apart the insane amount of time spent on precompiling assets for some reason I can say it’s compiling them twice. Why?

I’m using Rails 3.2.1.
Can someone offer some insight about what’s going on here? Is it intended?

staging.rb

  # Compress JavaScripts and CSS
  config.assets.compress = true

  # Don't fallback to assets pipeline if a precompiled asset is missed
  config.assets.compile = false

  # Generate digests for assets URLs
  config.assets.digest = true
  • 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-05-30T11:32:23+00:00Added an answer on May 30, 2026 at 11:32 am

    load 'deploy/assets' automatically precompiles assets for you in the appropriate part of the deploy so you don’t need to define a precompile task. You can remove both your precompile task and after "deploy:finalize_update", "deploy:precompile".

    https://github.com/capistrano/capistrano/blob/master/lib/capistrano/recipes/deploy/assets.rb

    edit: By default Rails will create fingerprinted files and non-fingerprinted files when you have digest set to true. It’s not actually running the entire precompile task twice, it’s just running one task for each situation.

    If you want to disable generating the non-fingerprinted files completely then you can override the assets:precompile:all task.

    Rake::Task['assets:precompile:all'].clear
    namespace :assets do
      namespace :precompile do
        task :all do
          Rake::Task['assets:precompile:primary'].invoke
          # ruby_rake_task("assets:precompile:nondigest", false) if Rails.application.config.assets.digest
        end
      end
    end
    

    The commented out line is line 66 here:

    https://github.com/rails/rails/blob/master/actionpack/lib/sprockets/assets.rake

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

Sidebar

Related Questions

A previously-working Rails 3.1 app is now failing to deploy. The Capistrano deploy:assets:precompile task
I have following code in my deploy.rb namespace :app do desc copies the configuration
I have a Rails app that I'm trying to deploy with Capistrano (which I've
Is there a way to have capistrano run unit tests on my Rails app
So this is my problem. I used Capistrano to deploy my Rails 3 app
In response to this blog post: http://www.simonecarletti.com/blog/2009/02/capistrano-uploads-folder/ I have three questions: Can anyone confirm
I have a Ruby on Rails 3.2 app using bundler and capistrano for deployment.
A lot of Capistrano example recipes include a :db role. By default the deploy
I have 3 separate staging servers set up in capistrano (and may have more
We have a rails application in subversion that we deploy with Capistrano but have

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.