LoginSignup
0
0

More than 3 years have passed since last update.

Railsアプリのherokuデプロイ

Posted at

heroku CLIインストール(初回のみ)

% brew tap heroku/brew && brew install heroku

ログイン

heroku login --interactive
 => Email:
 => Password:

アプリケーション作成

heroku create アプリ名

ClearDBアドオン

% heroku addons:add cleardb

% heroku_cleardb=`heroku config:get CLEARDB_DATABASE_URL`

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

環境変数の設定

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

gitをherokuにpush

git push heroku main

マイグレーション

heroku run rails db:migrate

ログ確認

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