[Must-see for beginners] rails_12factor is not required to publish Rails app to Heroku

It is an article as the title says.

Articles that explain how to deploy a Rails application to Heroku often include the installation of the rails_12factor gem in the steps. However, this gem is no longer needed in Rails 5 and later.

Gemfile


group :production do
  #Rails 5 and above_No need for 12factor! !!
  gem 'rails_12factor'
end

Rails 5 was released in 2016, more than four years ago. As of 2020, when Rails 6 is the latest version, very few people will bother to deploy new Rails apps prior to Rails 4. So I can assure you that you no longer need to install this gem.

So far, installing this gem on Rails 5 or later doesn't seem to cause any problems, but since the final release date is October 14, 2014, the gem maintenance has already stopped. Imagine. (Reference)

Screen Shot 2020-11-14 at 14.42.11.png

Since maintenance is stopped, even if there are no problems now, it is undeniable that there may be some problems if you continue to use this gem in the future. It's a good idea to uninstall it quickly, as you can lose it but not gain it.

Digression: A reliable source rather than a handy source

Below is a digression.

In my personal observation range, I think that many people who write articles that include the installation of rails_12factor gem in the procedure are new to programming. And, this is also my personal guess, I feel that such a person is reproducing the deployment procedure of Heroku by referring to the Japanese article found on the net.

If this happens, the parent turtle will give birth to a baby turtle, the baby turtle will give birth to a grandchild turtle, the grandchild turtle will ... and so on, and articles with older content will be reproduced more and more.

Certainly, it is easy to refer to "Japanese articles found by Gugu". It's easy, but the article isn't always accurate and reliable. It may be correct at the time the article was written, but it may be unusable information over time.

So what is an accurate and reliable source of information? It is official information about languages, libraries and platforms.

For the deployment procedure on Heroku, the following article published by Heroku itself corresponds to it. If you want to know how to deploy to Heroku, you should refer to this article first.

Getting Started on Heroku with Rails 6.x | Heroku Dev Center

In this article, it is clearly stated that "I don't need rails_12factor anymore ".

Previous versions of Rails required you to add a gem to your project rails_12factor to enable static asset serving and logging on Heroku. If you are deploying a new application, this gem is not needed.

(Translated by the author)

Earlier versions of Rails required the addition of rails_12factor gem to enable static assets and logging on Heroku. You don't need this gem when deploying a new application.

It may be difficult to read English, but beginners who want to become engineers will not be able to avoid English in the future. If you want to be a professional engineer, you should refer to "information that is a little difficult but accurate and reliable (= official information in English in many cases)" rather than "information that is easy to read but inaccurate".

If you install the rails_12factor gem, you won't have a big problem, but in the future, you may end up creating an application with a major security problem because you have referred to inaccurate information. Hmm. Before making such a big mistake, it is highly recommended that you now add a habit of referencing reliable sources.

Recommended Posts

[Must-see for beginners] rails_12factor is not required to publish Rails app to Heroku
I tried to introduce Bootstrap 4 to the Rails 6 app [for beginners]
MySQL is not running stably ... Rails app is not running.
[Rails] Add page nation to table [For beginners]
rails new app is not created with app name
How to implement login request processing (Rails / for beginners)
Heroku app moving (rails)
Tutorial to create a blog with Rails for beginners Part 1
Tutorial to create a blog with Rails for beginners Part 2
Tutorial to create a blog with Rails for beginners Part 0
[Rails] How to display error messages for comment function (for beginners)
How to solve the problem that the website image is not displayed after deploying to heroku on Rails 5
What to do if the app is not created with the latest Rails version installed when rails new
(For beginners) [Rails] Install Devise
[Rails] fields_for is not displayed
Must-see for beginners! How to manage your Xcode project on Github
[Rails] What to do if data is not registered in DB
[RSpec on Rails] How to write test code for beginners by beginners
[For beginners] Ruby is said to be ruby, but what about it?
[Rails] resources, member, collection Routing/named path/how to remember URL [for beginners]