RailsのproductionでActionViewTemplateError

エラー内容

stage環境などでは、そのままで大丈夫だが、productionではprecompileをしないとassetファイルがなくて、下記のようなエラーが出力される。(という解釈)

ActionView::Template::Error (The asset "application.css" is not present in the asset pipeline

解決方法

下記rakeタスクでコンパイルする。

bundle exec rake assets:precompile RAILS_ENV=production

それでも解決しない場合、ENVでファイルをRailsから配信するように設定されている可能性があるので確認する。