Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restart a rails server on Heroku?

People also ask

How do I restart rails?

You can restart the application by creating or modifying the file tmp/restart. txt in the Rails application's root folder. Passenger will automatically restart the application during the next request. Depending on the version of Passenger installed on the server, restart.

How do I auto restart heroku app?

As far as I can tell, simply running heroku ps:restart --app APPNAME in the Heroku Scheduler add-on works fine.

How do I restart a heroku dyno?

TIP By default heroku restart will restart all of your dynos, but you can specify a specific dyno to restart (e.g. heroku ps:restart web. 1 ), or all dynos of a specific type (e.g. heroku ps:restart web ).


The answer was:

heroku restart -a app_name

# The -a is the same as --app

Easily aliased with alias hra='heroku restart --app '
Which you can make a permanent alias by adding it to your .bashrc or .bash_aliases file as described at: https://askubuntu.com/questions/17536/how-do-i-create-a-permanent-bash-alias and
Creating permanent executable aliases
Then you can just type hra app_name

You can restart a specific remote, e.g. "staging" with:

heroku restart -a app_name -r remote_name

Alternatively if you are in the root directory of your rails application you can just type

heroku restart

to restart that app and and you can create an easy alias for that with

alias hr='heroku restart'`

You can place these aliases in your .bashrc file or (preferred) in a .bash_aliases file which is called from .bashrc


Go into your application directory on terminal and run following command:

heroku restart

If you have several heroku apps, you must type heroku restart --app app_name or heroku restart -a app_name


Just type the following commands from console.

cd /your_project
heroku restart

heroku ps:restart [web|worker] --app app_name

works for all processes declared in your Procfile. So if you have multiple web processes or worker processes, each labeled with a number, you can selectively restart one of them:

heroku ps:restart web.2 --app app_name
heroku ps:restart worker.3 --app app_name