Terminal
brew tap heroku/brew && brew install heroku
Terminal
heroku --version
Terminal
#Command to log in to Heroku
% heroku login --interactive
=> Enter your Heroku credentials.
#Enter your email address and press enter
=> Email:
#Enter your password and press enter
=> Password:
Gemfile
#Add to the bottom line of the file
group :production do
gem 'rails_12factor'
end
Terminal
#Install Gem
% bundle install
Terminal
% git add .
% git commit -m "gem rails_Addition of 12 factors"
Terminal
%heroku create application name
Terminal
% git config --list | grep heroku
Terminal
% heroku addons:add cleardb
Creating cleardb on ⬢ Application name... free
Created cleardb-vertical-00000 as CLEARDB_DATABASE_URL
Use heroku addons:docs cleardb to view documentation
Terminal
% heroku_cleardb=`heroku config:get CLEARDB_DATABASE_URL`
Terminal
% heroku config:set DATABASE_URL=mysql2${heroku_cleardb:5}
#Below, the command execution result
Setting DATABASE_URL and restarting ⬢ Application name... done, v◯◯
DATABASE_URL: mysql2://000000000000:[email protected]/heroku_aaa00000000?reconnect=true
Terminal
% EDITOR="vi" bin/rails credentials:edit
Terminal
% heroku config:set RAILS_MASTER_KEY=`cat config/master.key`
Terminal
% heroku config
Terminal
% git push heroku master
Terminal
% heroku run rails db:migrate
Terminal
% heroku apps:info
===ajax-app-123456
Addons: cleardb:ignite
Auto Cert Mgmt: false
Dynos: web: 1
Git URL: https://git.heroku.com/Application name.git
Owner: [email protected]
Region: us
Repo Size: 165 KB
Slug Size: 56 MB
Stack: heroku-18
Web URL: https:/Application name.herokuapp.com/
Recommended Posts