Rails Tutorial Part 2: Setting Up a Server on Heroku for Free!

Continuing from my previous post, in part two of this Rails Tutorial I am going to continue to add to my nascent project. The theme of the project is getting set up on heroku with lots of cool addons … for FREE!.

In part two we will be adding, as promised:

  • Papertrail: an awesome log management service (free)
  • New Relic: Site monitoring (free)
  • PG Backups: postgres backup (free)

Like most heroku add-ons, adding Papertrail was a piece of cake. Just go to the Papertrail add-on page and choose the “Choklad” (i.e. FREE) option. Done.

I add New Relic by simply going to¬†https://addons.heroku.com/ and selecting the either the ‘Stark’ or ‘Wayne’ free version. (I’m not sure which one will better suit my needs, but I’ll go with the one that offers more features for now. I can always switch to another configuration later.)

When I went to verify that everything was connecting, however, I only received a generic message saying “Welcome, ! Thanks for taking advantage of our partnership with heroku.” For some reason it’s not clicking.

Turns out my server was not running correctly. Fortunately, Papertrail helped me track down the source of the issue: My app was not connecting to the Postgres DB successfully. The error message was “FATAL: password authentication failed for user “zapetulgfrdywm” (PG::Error).”

StackOverflow to the rescue, of course. I had to “promote” my heroku DB – I guess it was trying to use the credentials from my local DB. Once I did that the errors went away and my server was up and running successfully.

At this point I went back to New Relic to see if it was starting to show any monitoring information. It wasn’t. Solution: Fortunately it was simple. I just restarted heroku

heroku restart

Not much to show so far, of course, but it looks like it’s running. Yay!

Finally, I’d like to add PG Backups to make regular, automatic (and FREE) backups of my DB. To add it, just go to the PG Backups page and choose one of the three options: “Auto – One Month Retention,” “Auto – One Week Retention,” or “Plus.” I must admit I don’t really understand the differences between the options. The “Plus” option seems geared toward people who want to only do manual backups, but the two “Auto” options seem pretty similar. Maybe the One Month Retention option seems superior. That’s the one I chose anyway. Maybe I’ll discover something preferable about the One Week Retention option later.

Looks like I’m ready to start coding! More specifically, I’m ready for part 3: Getting users authenticated so they can eventually create content for my site.

One thought on “Rails Tutorial Part 2: Setting Up a Server on Heroku for Free!

  1. Pingback: Rails Tutorial: Setting Up a Server on Heroku for Free!Blog de Code

Leave a Reply