LoginSignup
1
2

More than 5 years have passed since last update.

Herokuにアップする時の手順メモ(PostgreSQLを利用する場合)

Posted at

前提

Herokuのアカウント作成Heroku Toolbeltのインストールは終えているものとします。
何度かデプロイしてるけど、細かいところを忘れちゃう、という方向けです。

デプロイまでの手順

アプリケーションのあるディレクトリに移動してから、以下を実行する。

$heroku login
Gemfile
gem 'rails_12factor'
gem 'pg'

Gemを追加してからbundle install

config/environments/production.rb
config.assets.compile = true
$ heroku create

アプリ名は自動で割り振られる。自分でつけたい場合はcreateの後に指定する。

$ git init
$ git add .
$ git commit -m "commit message"
$ git push heroku master

GitでHerokuにプッシュする。

$ heroku run rake db:migrate

Heroku上でマイグレートを実行する。

以上!
、、、エラーが出なければ。笑

1
2
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
1
2