Skip to content

Stop injecting rails_12factor from the Heroku generator - #672

Merged
tricknotes merged 1 commit into
mainfrom
heroku-generator-drop-rails-12factor
Sep 7, 2026
Merged

Stop injecting rails_12factor from the Heroku generator#672
tricknotes merged 1 commit into
mainfrom
heroku-generator-drop-rails-12factor

Conversation

@tricknotes

Copy link
Copy Markdown
Owner

Why

rails generate ember:heroku added rails_12factor to the project's Gemfile for the staging and production groups.

The gem exists to backport twelve-factor behaviour — logging to stdout and serving static assets in production — onto Rails 4, which Rails has done natively since 5.0. Its own README says a new Rails 5 application does not need it, and its repository was archived in February 2022.

Every Rails version this gem supports is >= 5.2 (README.md, "Ruby and Rails support"; the CI matrix runs 7.2, 8.0, 8.1 and main), so the injection could only ever add an unmaintained dependency to a project that has no use for it.

What changed

  • Removed HerokuGenerator#inject_12factor_gem.
  • Removed the "This will install the following gems: rails_12factor" line from the generator's USAGE.
  • Added a spec asserting the generator leaves the Gemfile untouched. Renamed the create_empty_gemfile_for_bundler helper to create_empty_gemfile — with no gem action left, the file is now the fixture the assertion reads rather than a prerequisite for Thor.
  • CHANGELOG entry with the upgrade note (remove rails_12factor from your Gemfile).

Verification

$ bin/rspec spec/generators
6 examples, 0 failures

The new spec was confirmed meaningful: with inject_12factor_gem restored it fails with +gem "rails_12factor", group: [:staging, :production] in the diff.

Full spec/lib also passes here except EmberCli::App#test exits with exit status of 0, which fails on main in this container too — ember test reports Launcher Chrome not found, unrelated to this change.

Note on merge order

This branch and #671 both edit lib/generators/ember/heroku/USAGE; whichever merges second needs a small conflict resolution.

🤖 Generated with Claude Code

https://claude.ai/code/session_014rAfkAVGVifbaEoTVeT66u


Generated by Claude Code

`rails generate ember:heroku` added `rails_12factor` to the `Gemfile`
for the `staging` and `production` groups.
The gem exists to backport twelve-factor behaviour — logging to stdout and
serving static assets in production — onto Rails 4,
which Rails has done natively since `5.0`.
Its own README says a new Rails 5 application does not need it,
and its repository was archived in February 2022.

Every Rails version this gem supports is `>= 5.2`,
so the injection could only ever add an unmaintained dependency
to a project that has no use for it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014rAfkAVGVifbaEoTVeT66u
@tricknotes
tricknotes marked this pull request as ready for review September 7, 2026 12:13
@tricknotes
tricknotes merged commit df35e48 into main Sep 7, 2026
12 checks passed
@tricknotes
tricknotes deleted the heroku-generator-drop-rails-12factor branch September 7, 2026 12:13
@tricknotes tricknotes mentioned this pull request Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants