Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capistrano giving error from old release. ActionView::MissingTemplate

I have deployed my app using capistrano on AWS, with nginx and unicorn. When I open my home page, its empty. This is my unicorn log

Started GET "/" for 111.111.111.111 at 2014-03-10 12:50:02 +0000
Processing by StaticController#index as HTML
Completed 500 Internal Server Error in 236ms

ActionView::MissingTemplate (Missing template static/index with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee, :haml]}. Searched in:
  * "/home/deployer/apps/my-app/releases/20140310084512/app/views"
  * "/home/deployer/apps/my-app/shared/bundle/ruby/1.9.1/gems/twitter-bootstrap-rails-2.2.8/app/views"
  * "/home/deployer/apps/my-app/shared/bundle/ruby/1.9.1/gems/glimpse-redis-1.1.0/app/views"
  * "/home/deployer/apps/my-app/shared/bundle/ruby/1.9.1/gems/glimpse-git-1.0.1/app/views"
  * "/home/deployer/apps/my-app/shared/bundle/ruby/1.9.1/gems/glimpse-0.0.5/app/views"
  * "/home/deployer/apps/my-app/shared/bundle/ruby/1.9.1/gems/kaminari-0.15.1/app/views"
  * "/home/deployer/apps/my-app/shared/bundle/ruby/1.9.1/gems/devise-3.2.3/app/views"
  * "/home/deployer/apps/my-app/releases/20140310124541"
  * "/"
):
  app/controllers/static_controller.rb:8:in `index'

My latest release is 20140310124541, but the missing template error is coming from a previous release 20140310084512. What could be the issue. The current folder symlink is created properly.

like image 787
Santhosh Avatar asked Mar 10 '14 13:03

Santhosh


1 Answers

You will need to make sure that you restart nginx/unicorn. Once a program looks up a folder/file in symlink, it will point to the target. So, when capistrano points current to the latest release, nginx still is looking at old target which is now most likely deleted.

Make sure you have restart taks setup as shown here: https://github.com/sosedoff/capistrano-unicorn

like image 170
akshah123 Avatar answered Nov 10 '22 19:11

akshah123