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 is load 'deploy/assets'
, but I'm trying to understand what is happening here.
I am deploying an instance of Amazon EC2 m1.small , which, apparently, constantly 50% of the time the processor was stolen , was checked with top
. This leads to an increase in compilation time, but 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
Besides the insane amount of time spent precompiling the assets, for some reason I can say that it compiles them twice. Why?
I am using Rails 3.2.1. Can someone give an idea of ββwhat is going on here? Is this provided for?
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
source share