Michael Durrant
Michael Durrant

Reputation: 96454

How to restart a rails server on Heroku?

Locally I just interrupt (ctrl-c) and then start it again.

How do I do the same thing with an app on heroku?

Upvotes: 249

Views: 159841

Answers (5)

matiasdim
matiasdim

Reputation: 527

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

Upvotes: 24

Michael Durrant
Michael Durrant

Reputation: 96454

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

Upvotes: 475

RAJ
RAJ

Reputation: 9747

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

heroku restart

Upvotes: 38

vijay chouhan
vijay chouhan

Reputation: 1012

Just type the following commands from console.

cd /your_project
heroku restart

Upvotes: 17

catsby
catsby

Reputation: 11342

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

Upvotes: 16

Related Questions