I noticed that the new version of Michael Hartl's Ruby on Rails Tutorial says to include the following to serving static assets on Heroku
gem 'rails_12factor', group: :production
The previous version of his book did not have that. Can someone explain the details of what happened with Heroku that requires this gem?
The best answer I could find is by looking at the rails_12factor README.
There's also a discussion on why Heroku decided to include the gem: Why does this gem exist? Especially read the answer from schneems about halfway down the page.
This gem enables serving assets in production and setting your logger to standard out, both of which are required to run a Rails 4 application on a twelve-factor provider. The gem also makes the appropriate changes for Rails 3 apps.
In the Getting Started with Rails 4.x on Heroku, we can read this:
Heroku integration has previously relied on using the Rails plugin system, which has been removed from Rails 4. To enable features such as static asset serving and logging on Heroku please add rails_12factor gem to your Gemfile.
Older question, but FWIW Rails 5 Apps do not require the rails_12factor
gem. Per the README
:
We worked with the Rails core team to make Rails 5 work on twelve-factor platforms out of the box.
There is also a snippet for migrating to Rails 5.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With