Awesome
My first heroku app!
Used a Udacity course.
The steps:
- (heroku account)
- (heroku toolbelt)
heroku login
- (git)
- (fork)
- (clone)
cd galeria
git status
heroku create
git remote -v
git push heroku master
heroku open
- (I changed my app’s URL/name to "my-galeria" at https://dashboard.heroku.com/)
git remote rm heroku
heroku git:remote -a my-galeria
heroku open
(should take you to https://my-galeria.herokuapp.com/)
Staging = mock test; Deploying = final production push
https://devcenter.heroku.com/articles/multiple-environments
Local computer vs remote server
local computer:
<command>
remote server:
heroku run <command>
Setting up a database for the app:
git checkout -b pg origin/pg
(to create branch "pg" = PostgreSQL database for Ruby as required by Heroku)- or
git checkout origin/pg
- or
- (postgresql: http://postgresapp.com/ or http://www.postgresql.org/download/windows/ or http://www.postgresql.org/download/linux/ubuntu/)
bundle install
(to check the ActiveRecord gem that translates ruby to sql is stable locally)ruby app.rb
- (visit localhost:4567 to see a Sinatra error)
- (shut down server)
rake db:migrate
(to create database table)ruby app.rb
- (localhost:4567)
git branch
(check on pg branch)git push heroku HEAD:master
heroku open
(should get internal server error)heroku run rake db:migrate
(should get error cannot find database connection b/c no postgresql addon included in heroku)heroku addons:create heroku-postgresql
(to include the postgresql addon)heroku run heroku run rake db:migrate
(to try database migrations again in the heroku server)- (refresh page)