7
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

herokuでアプリのサーバにsshログイン

Last updated at Posted at 2020-10-09

1 アプリのディレクトリに移動&&herokuログイン

$ cd app_name
$ heroku login --interactive

2 ssh接続したいアプリを指定

$ heroku git:remote --app app_name

3 sshでサーバに接続

$ heroku run bash

※ Herokuで"Run console" が実行できなくなってしまったときの対処法

1 コマンド実行後、下記のように稼働中の one-off processesが確認できた場合、
該当プロセスを止める必要があります。

$ heroku ps
Free dyno hours quota remaining this month: 978h 53m (97%)
Free dyno usage for this app: 20h 4m (2%)
For more information on dyno sleeping and how to upgrade, see:
https://devcenter.heroku.com/articles/dyno-sleeping

=== run: one-off processes (1)
run.2767 (Free): up 2018/11/23 21:06:53 +0900 (~ 9m ago): bash

=== web (Free): node server.js (1)
web.1: up 2018/11/23 21:12:24 +0900 (~ 4m ago)

2 下記コマンドで、プロセスIDを指定して該当プロセスを終了します。

$ heroku ps:stop run.2767(プロセスID)
7
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?