Successful Upload to Heroku

Lawson Hung
2 min readApr 24, 2020

This past week has been ecstatic for me. I finally got my backend server uploaded to Heroku!

After trying for a month and a half, I was stoked that my server finally worked. I couldn’t have done it by myself though. My project partner gave me some advice on how he uploaded our project to Heroku and showed me how to connect my GitHub directly, which is much easier than whatever I was trying to do. He also showed me how my secret was being stored locally, so I had to hard code it in. Shout out to my Let’s Chat app partner!

On Heroku, there’s a Deploy tab that allows you to connect your backend directly to a GitHub repo. There, you just follow the steps to connect your GitHub repo to Heroku, and you’re all set! It even automatically deploys the master branch, so whenever you make a Pull Request or push to the master branch, Heroku automatically updates that for you.

What I was trying to do before, and did not work at all, was use the Heroku CLI which was actually suggested by Heroku.

You have to make a Procfile to declare what commands Heroku will run. For instance, for Ruby/Rails applications like mine, you have to run $ rails s in the terminal/command prompt to start your server.

Also, in addition to the Procfile, you also have to change the config/puma.rb file as well.

I could not figure out for the life of me how to get past these steps on the Heroku CLI though, and ended up using the GitHub deploy option instead. Hopefully you’ll have better luck than me using the Heroku CLI.

Stay in, and stay safe during Covid-19 times! Wash your hands frequently and keep 6 feet apart.

--

--