Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First the predispositions, i like to have my heroku git remotes set up as staging and production so you can easily use git push staging/production to deploy to each one of them. I'll be using that setup to explain how to make a staging env.</p> <ol> <li>create a <code>config/environments/staging.rb</code> which you will copy off `config/environments/production.rb'</li> <li>add a database.yml entry for the staging database(not really needed for heroku but can't hurt)</li> <li>Backup your .env file (if you have it)</li> <li>Install heroku-config plugin by <code>heroku plugins:install git://github.com/ddollar/heroku-config.git</code></li> <li>pull your environment settings from heroku(production server) with <code>heroku config:pull --remote production</code></li> <li>make changes to the .env file and don't forget to add these values to the config: <code>RACK_ENV=staging RAILS_ENV=staging</code> so it will use the staging environment configuration.</li> <li>fork a heroku environment with <code>heroku fork -a production staging</code> (those are heroku appnames you want instead of production/staging)</li> <li>Do a `heroku config:push --remote staging'</li> <li>Be sure to deploy the code to staging env properly</li> </ol> <p>You can also read this tutorial, i think i used it to get started with multiple envs on heroku: <a href="https://devcenter.heroku.com/articles/multiple-environments#managing-staging-and-production-configurations" rel="noreferrer">https://devcenter.heroku.com/articles/multiple-environments#managing-staging-and-production-configurations</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload