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_12facto
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.
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.
As of Rails 5, you no longer need to include this gem in your Gemfile
. They've removed it from their documentation also: https://github.com/railsbridge/docs/issues/569
Just ran into a problem with a Rails 4 application on Heroku and couldn't debug it with heroku run logs
. Without the rails12factor
gem, you can't see the full logs that you normally see on your console in development. I was getting a 500 error and there wasn't any available information.
It actually didn't tell me that migrations were pending without rails12factor
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.
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.