Rails/React launch on Heroku
For the past week, I have been messing around with some of my old applications trying to get them hosted on Heroku. I have heard it is finicky depending on what framework you’ve used or what database you might have started with so I made sure to do my research before going into it. Turns out, a lot of people have wrote some excellent pieces explaining the steps. I don’t plan on spending time today trying to replicate some of them. Instead, I wanted this to be a bit of a resource to weave between some that I found helpful.
First, this blog was a very helpful guide for me. I found that I didn’t need to veer too far off from it but that doesn’t mean I didn’t hit some snags. If you find yourself unable to pair up your gems with Heroku, checking the logs can be super helpful. I found mine telling me that my Ruby version was outdated slightly and I would need to update that to work with their 20 stack. 18 stack is still supported and I used this resource to install my back end app with the compatible Heroku 18 stack. Note, 18 stack will become obsolete in the next few years (2023) so if you have time, tinker with your project with an updated Ruby version. If you can’t/don’t, that resource provided above will do the trick.
The major struggles on setting it up seemed to be from the back end side. The only real issues I struggled with setting up React was having a yarn/npm mix up. Heroku was telling me I had two different lock files, one being yarn.lock and one being package-lock.json. This Stack Overflow helped guide me to what my problem was.
I hope these couple pointers can help you launch your project or help iron out that one problem your project is facing when you try to launch it. As always, happy coding!