MaggieMoss / sinatra-deployment-guide

Steps for deploying a sinatra app to heroku

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deploy Sinatra Apps to Heroku

  • Before deploying to heroku, you'll want to edit your Gemfile and your config/database.rb file. Use the examples in this repo as a guide.

NOTE: If you are deploying your finstagram app for the Intro to Web course your files should match exactly

Steps for deploying a sinatra app to heroku

  1. Create an account at heroku.com
  2. In the terminal, run:
  • heroku login
  • Next, you will be prompted to enter the email you entered for your Heroku account, along with the password (the cursor will not move when you enter your password).
  • Next, run: heroku create
  1. Back in the heroku dashboard (dashboard link):
  • Find the project that's been created for you, and click it.
  • Click the resources tab
  • Add an add-on for postgres: "Heroku Postgres"
  • Click it to view its details
  • Copy its URL (You’ll have to click a show button, it’ll be hidden) - it'll be a long string like: postgres://esfdizmindqtqp:W4B8yrM...
  • Edit your config/database.rb file to use this URL (~ line 9)
  1. Run bundle install
  2. Save your code using git:
  • a) git status
  • b) git add .
  • c) git commit -m "Readies app for deployment"
  1. Launch with: git push heroku
  2. Create the database: heroku run bundle exec rake db:migrate

Updating your app

  1. git add .
  2. git commit -m "your-descriptive-git-message"
  3. git push heroku

If you have made changes to the database

  1. heroku run bundle exec rake db:migrate

Links:

About

Steps for deploying a sinatra app to heroku


Languages

Language:Ruby 100.0%