Skip to content

Instantly share code, notes, and snippets.

@phlco
Last active August 29, 2015 13:58
Show Gist options
  • Save phlco/9934593 to your computer and use it in GitHub Desktop.
Save phlco/9934593 to your computer and use it in GitHub Desktop.
Heroku Checklist

Heroku Checklist

To enable features such as static asset serving and logging on Heroku please add rails_12factor gem to your Gemfile.

# Gemfile
gem 'rails_12factor', group: :production

You should be running the same version of Ruby on Heroku that you're running locally.

Verify by checking your Ruby version locally

$ ruby -v

Now ensure you're Gemfile has a versioned number of Ruby

# Gemfile
ruby "2.1.1"

If you're using a database be sure to migrate it and seed the db on Heroku

$ heroku run rake db:migrate

You can update your seeds.rb file to clear out any previous data

# seeds.rb
User.delete_all  # clears out all previous entries in users
User.create(name: "admin", password: "1234", password_confirmation: "1234", is_admin: true)

then...

$ heroku run rake db:seed

Add any environmental variables you're using

$  heroku config:set KEY=value

Trouble Shooting https://devcenter.heroku.com/articles/getting-started-with-rails4#runtime-dependencies-on-development-test-gems

@crywolfe
Copy link

crywolfe commented Apr 2, 2014

You may want to update your github heroku checklist to ensure everyone is doing a heroku run rake db:drop(heroku pg:reset DATABASE)... then heroku run rake db:seed after migrate...

@JayK31
Copy link

JayK31 commented Apr 2, 2014

you can do heroku run rake db:migrate, which will re-migrate the tables without the data, then heroku run rake:db seed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment