Capistrano

Upgrade Your Capistrano Config To Restart Using The Passenger Restart-app Tool

Posted by Weston Ganger on November 03, 2015

With the release of Passenger 4, they included a app restart command that functions better the touch tmp/restart.txt method.

With the old method the app would restart on the next request, using the restart-app command that app will restart immediately.

Here is how to upgrade your deploy.rb file for Capistrano.


# config/deploy.rb

# Capistrano 2
run "sudo passenger-config restart-app --ignore-app-not-running #{deploy_to}"

# Capistrano 3
execute :sudo, "passenger-config restart-app --ignore-app-not-running #{deploy_to}"
  • The --ignore-app-not-running is required otherwise your deploy might fail.
  • If you recieve an error regarding no Phusion Passenger Served Apps, dont worry its not a bad error


Related External Links:


Posted in Rails and Tagged with capistrano deploy rails ruby passenger 


Need help on your next project or application?

I specialize in Ruby-on-Rails, AngularJS, Javascript, Bootstrap, and Hybrid Mobile Apps with Cordova & Ionic.

Contact Me

Recommended Posts