Deploying To Heroku
Begin by saving your code in a version control system called git: Add the Project to a Git RepoThen, if you haven't yet deployed to heroku, start at First-time setup. Otherwise, start at Every time.
First-time setup
Step 1: Sign up for heroku
Step 2: Create a heroku application
Terminalheroku createStep 3: Create a Heroku key
Terminalheroku keys:addStep 4: Edit the Gemfile
gem 'sqlite3'
group :development, :test do gem 'sqlite3' end group :production do gem 'pg' gem 'rails_12factor' endStep 5: Apply the Gemfile changes
Terminalbundle install --without productionStep 6: Commit the Gemfile changes
Terminalgit add . git commit -m "Changed Gemfile for heroku"
Every time
Step 1: Commit any pending changes to git
Terminalgit statusTerminalgit add . git commit -m "Some helpful message for your future self"Step 2: Push changes to heroku
Terminalgit push heroku masterStep 3: Run database migrations on Heroku
Terminalheroku run rails db:migrateStep 4: Visit your application
Terminalheroku open