Heroku Tip Sheet

Monroe Mann

Published On: Nov 27, 2024

Editor’s Note: On all blog posts, we try to edit the writing as little as possible to preserve authenticity, personality, and writing style. We typically fix spelling errors, but minimally modify grammar and sentence structure (just enough to ensure readability).

Monroe Mann

Name: Monroe Mann Break Diving Level: Level 1 Number of Certified Dives: 15 From: United States In: United States

Monroe Mann is a Ruby on Rails web developer and the founder of BreakDiving.io

[Originally Published in 2017 -- Verify for Accuracy]

For you coders out there who are hosting your dynamic sites on Heroku, here are some helpful tips that you will likely use over and over that you may find helpful to have here in a central place.

For those of you who aren’t coders: there are two types of websites.  Normal ones that just list information, but do not store user information, are called static sites.  An example is a website for a business that just explains the business and has a contact form.  The other ones are called dynamic sites, and these actually store user information in a database.  Usually, the way you can tell if a site is dynamic is whether users can log in and log out.  That user data is stored in a database, and one of those online databases is known as Heroku.

Without further ado:

REMAINING MONTHLY DYNO HOURS: To check the number of dyno hours remaining, type this in git, while in the app’s git directory:


heroku ps -a heroku_app_name_here


SET PRODUCTION VALUES WITH FIGARO: To set heroku with the values from your configuration while using the rubygem “figaro”, type this in git, while in the app’s git directory:


figaro heroku:set -e production


RESET THE HEROKU SERVER:


heroku restart


ENTER THE HEROKU RAILS CONSOLE:


heroku run rails c


RAKE THE HEROKU DATABASE:


heroku run rake db:migrate


SEED THE HEROKU DATABASE:


heroku run rake db:seed


RENAME YOUR HEROKU APP: In git, in the app’s directory, run:


heroku apps:rename new_app_name_here -a current_app_name_here


CHECK THE DIFFERENCES BETWEEN HEROKU AND MASTER: In git, in the app’s directory, run:


git diff heroku/master


And more coming soon…  If there’s something you’d like to see here, let us know!

Break Diving, Inc. is a tax-exempt 501(c)(3) charitable organization.
Read all about our amazing mission at www.BreakDiving.org
Join our free community at www.breakdiving.io
Remember to tell your friends about this www.BreakDiving.blog



Read More Blog Posts on the Break Diving Blog Homepage