What You Need To Know About Hosting Your Rails App On Heroku?

You’ve designed a wonderfully self-contained web application, built to run on web browsers, unlike the kind of application your users would download from an app store. In your scenario, your application needs to find a home on the Web. In other words, it needs a Web address so your users can access your application through it, along with storage for your app’s code and associated background and data support to ensure traffic spikes won’t be able to whack it offline.

Many first timers choose to go with shared hosting since they can shell out comparatively less for it. You’ll find enough shared hosting companies which provide support for Rails. Once your developers fiddle around a bit with it, they’ll be able to upload your RoR files soon enough. Keep in mind; chances are, it doesn't come with support for any deployment tools. Furthermore, when you need to install any gems, they’ll be a procedure in place, and you’ll have to go through it each time you install a gem. Considering a typical Rails app can easily have 10-15 gems, this procedure will prove tiresome soon. There are exceptions, but most often than not this is the experience you’ll have with most non-specialized Rails shared hosting environments. Unless your application is elementary, go for something with dedicated support for Rails, like Heroku.

Heroku is a name you would’ve come across while searching for a place your app could call home on the Internet. You’ll notice, Heroku does it’s best to simplify your deployment process, trying to bring it down to a couple of clicks. Nevertheless, the ease of deployment will eventually depend on the complexity of your application, like what sort of gems you use, etc. and you probably will have to change a couple of things in the code and learn Git and S3. Unless of course your developers have built the app with built-in “Heroku compatibility”. The scale is another big reason, Heroku is a favorite among developers. Heroku can accommodate a huge number of users even if your modest app suddenly becomes the new big thing.

Getting Started with Heroku

  • Signing up is an easy and quick process, all you need is a mail id and password. Heroku comes with a lot of useful add-ons, chances are you’ll find a use for a lot of those. If so, then you’ll have to put in your card details. Either way, the best thing is, you can start with a free hosting plan.

  • Also, make sure to install the Heroku Toolbelt in your local workstation. It’s a resource which bundles three tools. The Heroku command-line client is a tool for managing and creating Heroku apps, Foreman, to let you run your apps locally and Git, the revision control system which allows you to push apps to the Heroku stack. With the Toolbelt, you can easily create, manage, test, and deploy apps from your PC.

  • Install Git. I presume you have Rails installed locally. On top of which, you must also have Git installed for Heroku to work.

  • For you to install the Heroku gem, run the “gem install Heroku.” Once you’ve installed the gem, attempt running “Heroku,” it must list the available commands. See, the gem dependencies are installed by Heroku, for your application when you do a git push. This means it needs to have a .gems file in an easy to parse format.

  • Now we’re almost there, push your app, then migrate the database and open it in a web browser.

  • There you have it. Your application should be up and running on Heroku's servers.

You’ll soon find for yourself, Heroku is a great way of deploying your Rails app. Set it up according to the rules and deploying will prove to be a breeze. A single line of code will take care of it all. Although, if your developers haven’t been developing with the “cloud” architecture in mind, they’re in for some rewrites. On the positive side, they’ll only have to do it only once. One another positive of Heroku is, Heroku allows out-of-the-box collaboration, thanks to the power of Git-based hosting.

Ultimately, the best place to learn and understand Heroku is on it. In fact, Heroku comes with a good quick startup guide which you could easily follow if you need any more details. Of course, if you’d rather ping us for the answers, we’re right here.

Need help with product design or development?

Our product development experts are eager to learn more about your project and deliver an experience your customers and stakeholders love.

Read more