Posted almost 7 years ago. Visible to the public. Deprecated.

better rails app restart with the passenger restart-app tool

Use capistrano-passenger to restart your Rails app after each deployment.

With this command you can initiate an application restart without touching restart.txt. Unlike touching restart.txt, this tool initiates the restart immediately instead of on the next request.

If you want to use this with capistrano 2.x just replace the touch command:

- run "touch #{current_path}/tmp/restart.txt" + run "passenger-config restart-app --ignore-app-not-running #{deploy_to}"

If you are using capistrano 3.x:

- execute :touch, "#{current_path}/tmp/restart.txt" + execute "passenger-config restart-app --ignore-app-not-running #{deploy_to}"

Note: If you using a passenger lower than 5.0.10 you have to use sudo to run this command.

If using it with capistrano you should use passenger >=4.0.41 and the --ignore-app-not-running parameter otherwise your deploy may fail.

When deploying with capistrano it's possible you get this "error" message:

*** [err ::] There are no Phusion Passenger-served applications running whose paths begin with '/var/www/'. *** [err ::]

This is just because there were no running passenger instance on the server. It's not a real error.

Does your version of Ruby on Rails still receive security updates?
Rails LTS provides security patches for old versions of Ruby on Rails (3.2 and 2.3).

Owner of this card:

Kim Jahn
Last edit:
over 2 years ago
by Besprechungs-PC
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Kim Jahn to makandra dev
This website uses short-lived cookies to improve usability.
Accept or learn more