7
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CapistranoでデプロイしたRailsアプリのproductionでActionView::MissingTemplateが出る時に見るTips

7
Last updated at Posted at 2016-06-13

結構ハマったので誰かの助けになればと思い共有。
結論から先に言うとunicornのstop,startをすれば解消すると思います。


bundle exec cap production unicorn:stop
bundle exec cap production unicorn:start

原因なのですが、unicorn:restartのbeforeやafterタスクがコケて過去ディレクトリを参照してしまう事によるものです。

実例としてリリース先ディレクトリは/data/rentranking/releases/20160613070708なのに、なぜか/20160514140547を参照してしまうという事が起こります。


FATAL -- :
ActionView::MissingTemplate (Missing template shared/lists with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :jbuilder, :haml], :mobile=>[]}. Searched in:
  * "/data/my_app/releases/20160514140547/app/views"
):
  app/controllers/products_controller.rb:19:in `show'

StackOverflowでも同種事例が挙げられていました。
http://stackoverflow.com/questions/22301048/capistrano-giving-error-from-old-release-actionviewmissingtemplate

wheneverでafter :restart, :update_cronタスクが動かない場合も、この事象である可能性があります。

7
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?