Skip to content

Instantly share code, notes, and snippets.

@libbyschuknight
Last active August 29, 2015 14:26
Show Gist options
  • Save libbyschuknight/fe3d33e32b6ae7051b5a to your computer and use it in GitHub Desktop.
Save libbyschuknight/fe3d33e32b6ae7051b5a to your computer and use it in GitHub Desktop.
Deploying Ruby on Rails app to Heroku
https://devcenter.heroku.com/articles/getting-started-with-rails4#local-workstation-setup
https://devcenter.heroku.com/articles/getting-started-with-ruby#introduction
heroku login
- To run on Heroku your app must be configured to use the Postgres database, have all dependencies declared in your Gemfile, and have the rails_12factor gem in the production group of your Gemfile
gem 'rails_12factor', group: :production
gem 'pg' - make sure have
bundle install
- In addition to using the pg gem, you’ll also need to ensure the config/database.yml is using the postgresql adapter.
heroku create pikadish-rubyrails
git push heroku master
heroku open
add Procfile
add puma gem
bundle install
echo "RACK_ENV=development" >>.env
echo "PORT=3000" >> .env
echo ".env" >> .gitignore
git add .gitignore
git commit -m "add .env to .gitignore"
gem install foreman
foreman start
heroku config:set MAX_THREADS=1
heroku ps
bundle exec rake db:create db:migrate
foreman start web
heroku run rake db:migrate
heroku run rake db:seed
-- resetting the pg db on heroku, will recreate the database with nothing in it:
$ heroku pg:reset DATABASE_URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment