Personal memorandum ruby 2.6.5 / Rails 6.0.3.4 / Mysql2
Gemfile
group :production do
gem 'rails_12factor'
end
bundle install => ** commit to master **
*** # Addendum *** ** This Gem installation doesn't seem to be needed in Rails 5 or later. ** ** ** It is not desirable to have a gem that seems to be out of maintenance already installed, so it seems better to uninstall unnecessary gems. ** **
Reference URL [Must-see for beginners] rails_12factor is not required to publish Rails app to Heroku
Terminal
%heroku create app name
App name cannot be used with _ (underscore)
Terminal
% git config --list | grep heroku
clearDB add-on
Terminal
% heroku addons:add cleardb
This changes the DB from Heroku's default DB (PostgreSQL) to Mysql
Reset the URL
Terminal
% heroku_cleardb=`heroku config:get CLEARDB_DATABASE_URL`
Define variables above
Terminal
% heroku config:set DATABASE_URL=mysql2${heroku_cleardb:5}
URL setting is complete
Terminal
% heroku config:set RAILS_MASTER_KEY=`cat config/master.key`
↓ Confirmation method
Terminal
% heroku config
Terminal
% git push heroku master
Terminal
% heroku run rails db:migrate
Terminal
% heroku apps:info
Terminal
% heroku logs --tail --app app name
What to do when Warning: heroku update available appears
Terminal
% heroku update
The image is probably unusable, so you may need to set up Amazon S3
✔︎
Recommended Posts