私はこのカピストラーノタスクがあります。Rails 3.2.1は、デプロイ時にプリコンパイルされたアセットですか?
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"
を私はload 'deploy/assets'
があることを知っているが、私はここで何が起こっているのかを理解しようとしています。私は明らかに常に50%のCPUを持っているアマゾンEC2 m1.smallインスタンスに展開しています
はtop
で検証時間を盗みます。 これは、資産をコンパイルするための時間の増加につながるが、これを見て:
[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。どうして?
私はRails 3.2.1を使用しています。 誰かがここで何が起こっているかについていくつかの洞察を提供することはできますか?それは意図されていますか?
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)私はそれとスプライトに問題がある2)私は何が起こっているかを明確にチェックしたいと思った。 – kain
私はいくつかの詳細と私の答えを更新しました。ありがとうございます; – James
;それぞれの状況に対して1つのタスクを実行することは私にとっては愚かなように思えます。なぜ地球上のレールでオプションをチェックすることができず、それに応じて1つのタスクしか実行できないのですか...ダイジェスト、誰かがダイジェストではなくダイエットしたいと思ったら、分けてください。 – kain