0
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デプロイ手順

0
Last updated at Posted at 2021-05-15

開発環境

Ruby 2.6.5
Ruby on Rails 6.0
My SQL
Heroku CLIをインストール済み

1. Heroku上にアプリケーションを作成

% heroku create <<アプリケーション名>>

2. ClearDBアドオンを追加

% heroku addons:add cleardb

3. 設定を変更(Ruby on railsを使う場合)

% heroku_cleardb=`heroku config:get CLEARDB_DATABASE_URL`
% heroku config:set DATABASE_URL=mysql2${heroku_cleardb:5}

4. Heroku上で環境変数を設定

% heroku config:set RAILS_MASTER_KEY=`cat config/master.key`

5. Herokuで利用するStackを指定(Ruby2.6.5が動作する場合)

% heroku stack:set heroku-18 -a <<アプリケーション名>>

6. Herokuへアプリケーションを追加

% git push heroku master

7. Heroku上でマイグレーションを実行

% heroku run rails db:migrate

8. 公開を確認

% heroku apps:info
% heroku open

9. デバッグ

% heroku logs --tail --app <<アプリケーション名>>
0
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
0
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?