Let's Build: With Ruby On Rails - Deploying An App To Heroku
Web-Crunch
Hi, My name is Andy Leverenz. I design, code, and am an author of things. Check out my blog Web-Crunch https://web-crunch.com🤘🏻
☕️Help me keep going: https://www.buymeacoffee.com/webcrunch
Deploying a Rails app can be a daunting experience. There are a vast number of hosts out there but many fail to compare to Heroku. In this single part screencast, I guide you through the process of deploying an app to Heroku.
Projekt
This article and video carry over from a previous Let's Build called :
Let's Build: With Ruby on Rails - Project Management App https://web-crunch.com/lets-build-with-ruby-on-rails-project-management-app/
I did a while back called Projekt. You can find that blog post here as well as all the videos.
⚙️ Download the Source Code: https://github.com/justalever/projekt
Key things to remember
Databases
Rails apps often default to sqlite
for the database. In terms of scalability and performance, you might want to opt for a different type of database for your production based apps. Luckily getting your app working in a completely new environment is quite easy with enough know how. In this guide, I opt for postgresql
as recommended by Heroku directly - https://devcenter.heroku.com/articles/getting-started-with-rails5#database.
Following Heroku's own written guide - https://devcenter.heroku.com/articles/getting-started-with-rails5 can get you extremely far if you are brand new to the process.
You can run postgresql
locally using the command line utility or using an app like Postgres (my preferred method). You still need to know some basic postgresql
commands to get up and running. This typically involves creating new roles and or databases manually. I referenced a Digital Ocean article to help with my own efforts. There are other articles in their tutorial section that can also shed some light on the subject. Digital Ocean is also a fantastic and affordable host but there's a lot more manual maintenance and setup here. If you're new I'd suggest at least starting with Heroku. Although a little daunting at first I found it the easiest to get up and running with.
Git
You have to use git when working with Heroku. The deployment process depends on a git repo to push your final production code to the remote app of your choosing.
Heroku CLI (Heroku Toolbelt)
This is probably the most comprehensive CLI I've used which gives you full control of your Heroku account via the command line. You can create apps, modify apps, deploy, configure, and more. Using the CLI as part of your deployment workflow saves a massive deal of time. Combined with git
you can deploy to any type of environment as you wish by adding more than one git remote
.
💻 Previously published at: https://web-crunch.com/lets-build-with-ruby-on-rails-deploying-an-app-to-heroku
💻 Check out the blog: https://web-crunch.com
🦄 Check out my personal site: https://justalever.com
🚀 Links: Weekly Newsletter: https://web-crunch.com/subscribe Twitter: https://twitter.com/webcrunchblog Twitter(Personal Account): https://twitter.com/justalever Facebook: https://facebook.com/webcrunchblog Dribbble: https://dribbble.com/justalever Github: https://github.com/justalever Medium: https://medium.com/the-web-crunch-publication
📘Check out my book on UX Design: "LUXD: Learn User Experience Design" https://web-crunch.com/books/luxd
📙 Check out my FREE book on Tumblr Theming: "Pro Tumblr Theming" https://web-crunch.com/books/ptt
💯 Need awesome web hosting? Check out cloudways. They allow me to use a variety of hosting providers and build apps with ease: http://bit.ly/webcrunchhosting ... https://www.youtube.com/watch?v=yWEMKKHT5QM
141867692 Bytes