{"id":15178,"date":"2021-02-17T14:56:43","date_gmt":"2021-02-17T09:26:43","guid":{"rendered":"https:\/\/www.botreetechnologies.com\/blog\/?p=15178"},"modified":"2021-09-09T16:04:28","modified_gmt":"2021-09-09T10:34:28","slug":"how-to-deploy-rails-app-to-heroku-in-5-minutes","status":"publish","type":"post","link":"https:\/\/www.botreetechnologies.com\/blog\/how-to-deploy-rails-app-to-heroku-in-5-minutes\/","title":{"rendered":"How to Deploy Rails App to Heroku in 5 Minutes"},"content":{"rendered":"\n<p>Heroku is a platform that enables developers to build, run, and operate applications entirely on the cloud with multi-language support for Ruby, Go, Scala, PHP, etc.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.botreetechnologies.com\/blog\/ruby-on-rails-web-development-framework\/\" target=\"_blank\" rel=\"noreferrer noopener\">Ruby on Rails is a popular web framework<\/a> written in Ruby. This guide covers how to deploy Rails 6 apps to Heroku.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Prerequisites for Deployment of Rails API To Heroku<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Basic familiarity with Ruby\/Rails and Git.<\/li><li>A locally installed version of Ruby 2.2.0+, Rubygems, Bundler, and Rails 5+.<\/li><li><a href=\"https:\/\/signup.heroku.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Signup<\/a> on Heroku.<\/li><\/ul>\n\n\n\n<p><strong>Local Setup:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Install the Heroku CLI on your development machine.<\/li><\/ul>\n\n\n\n<p><code>sudo snap install --classic heroku<\/code><\/p>\n\n\n\n<p><strong>Note: <\/strong>Your application should be uploaded to <a href=\"https:\/\/github.com\/BoTreeConsultingTeam\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a>.<\/p>\n\n\n\n<p><strong>Steps to deploy the application to Heroku:<\/strong><strong><br><\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Create an application on Heroku<br><\/li><\/ol>\n\n\n\n<p><code>heroku create \"app-name\"<\/code><\/p>\n\n\n\n<p>This will create an <a href=\"https:\/\/www.botreetechnologies.com\/ruby-on-rails-development\" target=\"_blank\" rel=\"noreferrer noopener\">Rails application<\/a> on Heroku like <strong>app-name.herokuapp.com<\/strong>.&nbsp;<\/p>\n\n\n\n<p>If you don\u2019t provide an app-name then Heroku will automatically generate a subdomain.<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li>Verify remote origins were added to your projects.<\/li><\/ol>\n\n\n\n<p><code>git config --list --local | grep heroku<\/code><\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li>Deploy your code.<br><\/li><\/ol>\n\n\n\n<p><code>git push heroku branch_name<\/code><\/p>\n\n\n\n<p><strong><br><\/strong><strong>Note: If you want to deploy a specific branch then you need to specify the branch name:parent_branch.<\/strong><strong><br><\/strong><\/p>\n\n\n\n<p><strong>For Eg:&nbsp;<\/strong><\/p>\n\n\n\n<p><strong>If you created a branch \u2018feature\/bulk_upload\u2019 from a master then you need to specify the branch_name as below for deployment:<\/strong><strong><br><\/strong><\/p>\n\n\n\n<p><code>git push heroku feature\/bulk_upload:master<\/code><\/p>\n\n\n\n<p><strong>Logs Check&nbsp;<\/strong><\/p>\n\n\n\n<p>Sometimes there arises a need to view the logs of the application then we can view the logs on Heroku using the below command:<br><\/p>\n\n\n\n<p><code>heroku logs --tail<\/code><\/p>\n\n\n\n<p><strong>Run Rails commands<\/strong><\/p>\n\n\n\n<p>If we want to migrate our database on Heroku, then use the below command:<br><\/p>\n\n\n\n<p><code>heroku run rails db:migrate<\/code><\/p>\n\n\n\n<p>Let&#8217;s ensure that your one dyno is up by the following command:<br><\/p>\n\n\n\n<p><code>heroku ps:scale web=1<\/code><\/p>\n\n\n\n<p>If we want use Heroku run rails console in our local machine, use the following:<\/p>\n\n\n\n<p><code>heroku run rails c<\/code><\/p>\n\n\n\n<p><strong>Visit the Rails application<\/strong><\/p>\n\n\n\n<p>This will open the application on the domain created in the browser.<br><\/p>\n\n\n\n<p><code>heroku open<\/code><\/p>\n\n\n\n<p>Congratulations! You have deployed your first <a href=\"https:\/\/www.botreetechnologies.com\/blog\/ways-to-improve-web-performance-with-rails\/\" target=\"_blank\" rel=\"noreferrer noopener\">Ruby on Rails application<\/a> on Heroku.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Heroku is a platform that enables developers to build, run,&#8230;<\/p>\n","protected":false},"author":56,"featured_media":15180,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73,10],"tags":[],"class_list":["post-15178","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ruby-on-rails","category-technology"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Deploy Rails App to Heroku in 5 Minutes<\/title>\n<meta name=\"description\" content=\"This is a simple guide that showcases how to deploy a Rails application on the cloud platform Heroku. Read this article to know the steps on how to do that.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Deploy Rails App to Heroku in 5 Minutes\" \/>\n<meta property=\"og:description\" content=\"This is a simple guide that showcases how to deploy a Rails application on the cloud platform Heroku. Read this article to know the steps on how to do that.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes\" \/>\n<meta property=\"og:site_name\" content=\"BoTree Technologies\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/BoTreeTechnologies\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-17T09:26:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-09T10:34:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2021\/02\/deploy-rails-app-to-heroku.png\" \/>\n\t<meta property=\"og:image:width\" content=\"852\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Hunny Jummani\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@BoTreeTech\" \/>\n<meta name=\"twitter:site\" content=\"@BoTreeTech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Hunny Jummani\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-deploy-rails-app-to-heroku-in-5-minutes\/\"},\"author\":{\"name\":\"Hunny Jummani\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/0d616df8a58c8145fae7ceb8d048e23e\"},\"headline\":\"How to Deploy Rails App to Heroku in 5 Minutes\",\"datePublished\":\"2021-02-17T09:26:43+00:00\",\"dateModified\":\"2021-09-09T10:34:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-deploy-rails-app-to-heroku-in-5-minutes\/\"},\"wordCount\":297,\"image\":{\"@id\":\"https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2021\/02\/deploy-rails-app-to-heroku.png\",\"articleSection\":[\"Ruby on Rails\",\"Technology\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-deploy-rails-app-to-heroku-in-5-minutes\/\",\"url\":\"https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes\",\"name\":\"How to Deploy Rails App to Heroku in 5 Minutes\",\"isPartOf\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes#primaryimage\"},\"image\":{\"@id\":\"https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2021\/02\/deploy-rails-app-to-heroku.png\",\"datePublished\":\"2021-02-17T09:26:43+00:00\",\"dateModified\":\"2021-09-09T10:34:28+00:00\",\"author\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/0d616df8a58c8145fae7ceb8d048e23e\"},\"description\":\"This is a simple guide that showcases how to deploy a Rails application on the cloud platform Heroku. Read this article to know the steps on how to do that.\",\"breadcrumb\":{\"@id\":\"https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes#primaryimage\",\"url\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2021\/02\/deploy-rails-app-to-heroku.png\",\"contentUrl\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2021\/02\/deploy-rails-app-to-heroku.png\",\"width\":852,\"height\":420,\"caption\":\"Deploy a Ruby on Rails Application on Heroku\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.botreetechnologies.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Deploy Rails App to Heroku in 5 Minutes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#website\",\"url\":\"https:\/\/www.botreetechnologies.com\/blog\/\",\"name\":\"BoTree Technologies\",\"description\":\"Committed to inspire generation.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.botreetechnologies.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/0d616df8a58c8145fae7ceb8d048e23e\",\"name\":\"Hunny Jummani\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/hunny-jummani-150x150.png\",\"url\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/hunny-jummani-150x150.png\",\"contentUrl\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/hunny-jummani-150x150.png\",\"caption\":\"Hunny Jummani\"},\"description\":\"I am a Ruby On Rails Developer. I love JavaScript, logical problem solving in Ruby and exploration of new things. Apart from coding, I also like to travel, listen music and play guitar.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Deploy Rails App to Heroku in 5 Minutes","description":"This is a simple guide that showcases how to deploy a Rails application on the cloud platform Heroku. Read this article to know the steps on how to do that.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes","og_locale":"en_US","og_type":"article","og_title":"How to Deploy Rails App to Heroku in 5 Minutes","og_description":"This is a simple guide that showcases how to deploy a Rails application on the cloud platform Heroku. Read this article to know the steps on how to do that.","og_url":"https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes","og_site_name":"BoTree Technologies","article_publisher":"https:\/\/www.facebook.com\/BoTreeTechnologies\/","article_published_time":"2021-02-17T09:26:43+00:00","article_modified_time":"2021-09-09T10:34:28+00:00","og_image":[{"width":852,"height":420,"url":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2021\/02\/deploy-rails-app-to-heroku.png","type":"image\/png"}],"author":"Hunny Jummani","twitter_card":"summary_large_image","twitter_creator":"@BoTreeTech","twitter_site":"@BoTreeTech","twitter_misc":{"Written by":"Hunny Jummani","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes#article","isPartOf":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-deploy-rails-app-to-heroku-in-5-minutes\/"},"author":{"name":"Hunny Jummani","@id":"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/0d616df8a58c8145fae7ceb8d048e23e"},"headline":"How to Deploy Rails App to Heroku in 5 Minutes","datePublished":"2021-02-17T09:26:43+00:00","dateModified":"2021-09-09T10:34:28+00:00","mainEntityOfPage":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-deploy-rails-app-to-heroku-in-5-minutes\/"},"wordCount":297,"image":{"@id":"https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes#primaryimage"},"thumbnailUrl":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2021\/02\/deploy-rails-app-to-heroku.png","articleSection":["Ruby on Rails","Technology"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-deploy-rails-app-to-heroku-in-5-minutes\/","url":"https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes","name":"How to Deploy Rails App to Heroku in 5 Minutes","isPartOf":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes#primaryimage"},"image":{"@id":"https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes#primaryimage"},"thumbnailUrl":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2021\/02\/deploy-rails-app-to-heroku.png","datePublished":"2021-02-17T09:26:43+00:00","dateModified":"2021-09-09T10:34:28+00:00","author":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/0d616df8a58c8145fae7ceb8d048e23e"},"description":"This is a simple guide that showcases how to deploy a Rails application on the cloud platform Heroku. Read this article to know the steps on how to do that.","breadcrumb":{"@id":"https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes#primaryimage","url":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2021\/02\/deploy-rails-app-to-heroku.png","contentUrl":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2021\/02\/deploy-rails-app-to-heroku.png","width":852,"height":420,"caption":"Deploy a Ruby on Rails Application on Heroku"},{"@type":"BreadcrumbList","@id":"https:\/\/dzone.com\/articles\/how-to-deploy-rails-app-to-heroku-in-5-minutes#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.botreetechnologies.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Deploy Rails App to Heroku in 5 Minutes"}]},{"@type":"WebSite","@id":"https:\/\/www.botreetechnologies.com\/blog\/#website","url":"https:\/\/www.botreetechnologies.com\/blog\/","name":"BoTree Technologies","description":"Committed to inspire generation.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.botreetechnologies.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/0d616df8a58c8145fae7ceb8d048e23e","name":"Hunny Jummani","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/hunny-jummani-150x150.png","url":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/hunny-jummani-150x150.png","contentUrl":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/hunny-jummani-150x150.png","caption":"Hunny Jummani"},"description":"I am a Ruby On Rails Developer. I love JavaScript, logical problem solving in Ruby and exploration of new things. Apart from coding, I also like to travel, listen music and play guitar."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/15178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/users\/56"}],"replies":[{"embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/comments?post=15178"}],"version-history":[{"count":3,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/15178\/revisions"}],"predecessor-version":[{"id":16279,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/15178\/revisions\/16279"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/media\/15180"}],"wp:attachment":[{"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=15178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=15178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=15178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}