Skip to content

Instantly share code, notes, and snippets.

@damwhit
Created April 19, 2016 18:02
Show Gist options
  • Save damwhit/1d8ae8d09fb1a92aa50780e697ca29e2 to your computer and use it in GitHub Desktop.
Save damwhit/1d8ae8d09fb1a92aa50780e697ca29e2 to your computer and use it in GitHub Desktop.
  1. Add gem 'rails_12factor' to your Gemfile. This will add error logging and the ability for your app to serve static assets.
  2. bundle
  3. Run RAILS_ENV=production rake db:create db:migrate db:seed
  4. Run rake secret and copy the output
  5. From the command line: export SECRET_KEY_BASE=output-of-rake-secret
  6. To precompile your assets, run rake assets:precompile. This will create a folder public/assets that contains all of your assets.
  7. Run RAILS_ENV=production rails s and you should see your app.
  8. No need to have username and password in database.yml under production for running production locally unless you want those things.

Remember to clobber your assets (rake assets:clobber) and re-precompile (rake assets:precompile) if you make changes. Always clobber before pushing to heroku!

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