Use Heroku Local to Maintain 12 Factor Parity for Your Rails Application

09 December 2016 on . 1 minute to read

12 Factor Environment Parity; keep all your application environments the same with Heroku Local.

In a few previous articles, ( Solr on Rails, Efficiently Run and Maintain Your Rails Application, Running Rails Apps Simultaneously During Development) I’ve recommended using Foreman to run your Rails applications in order to maintain the best development and production parity. However, it would appear that out of habit, I’ve been wrong on this for the last year, as Heroku has replaced Foreman in the toolbelt with Heroku Local).

So, still keep your Procfiles the same, but launch them with heroku local rather than foreman start

One noticeable improvement is that Heroku Local is more verbose about your .env file on boot, which is fantastic.

Verbose .env parsing

I’ve had a few days that started out poorly because of a typo in my .env that snuck in and completely killed a few hours hunting down invisible bugs that didn’t exist. As a side note, when that happens, step back after a few minutes, take a breather and down an espresso. You’ll come back much clearer.

I noticed this deviance in my current behavior when I was about to sit down and write an article on the importance of knowing and abiding by the 12 Factors. Instead, I found a few seconds in that my own Factor X had slipped. Best to publicly remedy it in case anyone else read it in past articles of mine.

If you enjoy having free time and the peace of mind that a professional is on your side, then you’d love to have me work on your project.

Contact or view a list of available services to see how I’ll make your life better, easier and bring satisfaction back into you running your business.