How to deploy the production build on Heroku?

Hi all, I’m a junior dev trying to build a side project with React on Rails.

I followed the instructions in the tutorial below closely and deployed to Heroku.
https://shakacode.gitbooks.io/react-on-rails/content/docs/tutorial.html

However, my chrome extension ‘React Developer Tools’ showed that my Heroku app is serving a development build. How can I deploy the production build instead?

Sorry for the noob question. Appreciate any help that comes my way. Thanks!

Hi @gohyifan!

That’s a good question!

The place to look is to study the logs from the deployment of Heroku.

I’d set these env vars on your Heroku instance:

RAILS_ENV=production
NODE_ENV=production 

And then push a new build.

That should solve your problems!

Cheers,

Justin

Sweet, it worked! Thanks, @justin.

1 Like