RAILS_ENV=production rails s
- this sets the key in the ENV hash
- you can also set these in different lines
- Go to "http://localhost:3000/" and you'll see this:
- Missing
secret_token
andsecret_key_base
for 'production' environment, set these values inconfig/secrets.yml
- Missing
- Run
rake secret
in terminal to generate a key RAILS_ENV=production rake db:{create,migrate}
- Delete username and password lines from database.yml under production
bundle exec rake assets:precompile
bundle exec rake assets:clobber
Other tips:
- You always need to restart server
command + K
- clears log so you can see what the errors are when you rerun
- gem rails_12factor puts errors into your log
tail -f log/development.log
(or any file)- Any time something gets written to a file, it outputs the text
- Put database.yml in gitignore
Rachel's instructions: https://gist.github.com/rwarbelow/40bd72b2aee8888d6d91