- 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
- Create an account at heroku.com
- 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
- 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)
- Run
bundle install
- Save your code using git:
- a)
git status
- b)
git add .
- c)
git commit -m "Readies app for deployment"
- Launch with:
git push heroku
- Create the database:
heroku run bundle exec rake db:migrate
git add .
git commit -m "your-descriptive-git-message"
git push heroku
If you have made changes to the database
heroku run bundle exec rake db:migrate
Links: