Stimulusの習作: ドラッグ・アンド・ドロップ: アプリをHerokuで公開する
内容
前回作成したアプリをHerokuで公開します。
リポジトリ
rails-ajax-heroku
fetch-heroku
参照
2020/03/20 The Heroku CLI | Heroku Dev Center
2020/04/19 Postgres.app – the easiest way to get started with PostgreSQL on the Mac
2017/11/15 SQLite on Heroku | Heroku Dev Center
2020/03/09 Logging | Heroku Dev Center
2020/03/16 Getting Started on Heroku with Rails 6.x | Heroku Dev Center
手順
準備
brew tap heroku/brew && brew install heroku
gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/latest/bin/pg_config
bin/rails db:system:change --to=postgresql
bundle install
# vim config/database.yml
git add .
git commit
アプリの作成と配置
heroku login
heroku create <APP_NAME>
heroku addons:create heroku-postgresql
git push heroku rails-ajax-heroku:master
# git push heroku fetch-heroku:master
heroku run rake db:migrate
heroku run rake db:seed
heroku open
heroku logs --tail
アプリの削除
heroku apps:destroy
# heroku addons:destroy heroku-postgresql:hobby-dev
# アプリを削除するとheroku-postgresqlも削除される。
以上です。