Direct answer
A Rails major upgrade is a sequence of separable stages, not one diff: read the upgrading guide and the maintenance policy, inventory configuration initializers, map dependency constraints, order framework changes, then review application edits. The official guides publish the upgrading steps and the policy behind support windows, and a staged checklist built from them is what keeps a major bump reviewable. The concrete win is an upgrade you can sequence: framework steps, initializer changes, dependency constraints, and application edits each land as their own reviewable stage. The concrete loss is that the maintenance policy text was only partly verifiable during research, so support dates and policy categories must be rechecked against the current page before a plan relies on them, and no codemod or configuration edit finishes an upgrade by itself.
Build the checklist from the guides before editing code. The application edits are the last stage, not the first.
Why an unordered upgrade costs a week
A major Rails bump touches the framework, the initializers, the Gemfile, and the application in ways that interact. Done in one pass, the result is a diff nobody can attribute and a failure nobody can locate.
Three costs follow. Review time goes up because a bundled upgrade diff mixes framework behavior with application changes. Debugging time goes up because a failure during a bundled upgrade could come from any stage. Rollback risk goes up because reverting one stage of a bundled upgrade reverts all of them.
Sequencing reverses all three. The framework meets your application at every stage, and each is a candidate for a conflict during a major bump. This post stays on the ordering and the inventory. It does not drift into Git, deployment, or general testing coverage, and it does not merge Rails and Ruby support policy, which are separate.
Start with the Upgrading Guide
The upgrading guide is the official reference for the steps a major version requires. The guide is the first input to the checklist, and reading it before editing code is what makes the sequence derived from evidence rather than from memory.
Official, F057: Rails publishes an upgrading guide and a maintenance policy as official references for major-version maintenance work. The maintenance URL returned only a redirect notice during research, and the guide pages were not fetched, so all policy wording and support dates must be rechecked against the current pages before drafting a plan that relies on them.
# read the upgrading guide for the version you target
# each major version section lists the steps that version requiresRead the guide for the specific version you target. Steps are version-specific, and a step that applied to a previous major may be obsolete for the one you are moving to. The guide is versioned, and the version you target is the one to read.
| Guide element | What it gives you | What you still need |
|---|---|---|
| Version-specific steps | What the framework requires | Whether your app already satisfies them |
| Deprecated behavior | What stopped working | Where your code depends on it |
| Configuration changes | What moved or renamed | Which initializers your app carries |
The table works as reading plan. The guide answers what the framework requires. Your application’s initializers and code answer where those requirements land. Neither alone produces a plan, and the sequence exists to join them.
Read the Maintenance Policy
The maintenance policy is the official statement of which versions receive which kind of support. The policy tells you whether the version you run is still maintained and what the target version’s support window looks like.
The maintenance page redirected during research and the policy guide pages were not fetched, so this post does not state support dates or policy categories. A plan that relies on them must cite the current maintenance page directly. The guardrail is explicit: do not invent support dates from memory.
| Policy question | Where the answer lives | Why it matters |
|---|---|---|
| Which versions are supported | Maintenance page | Whether the version you run gets fixes |
| Which kinds of fixes each gets | Maintenance page | Whether a bug fix or a security fix applies |
| Ruby compatibility | Ruby’s own policy, separately | Whether your Ruby version is supported |
Use the table as separation exercise. The last row is the one teams merge by accident: Rails support policy and Ruby support policy are separate documents with separate dates, and a plan that treats them as one produces the wrong window. The Django deprecation runway guide makes the same separation between a framework and a third-party package’s release policy.
Inventory Configuration Initializers
Rails stores application configuration in initializers under config/initializers and in the framework’s own configuration files. A major version can change what those files contain, and the upgrading guide describes how they are regenerated or updated.
ls config/initializers
# list the initializers your application carries
git log --oneline -- config/initializers
# see what your team has changed in themThe inventory is the list of initializers and configuration files your application carries, plus any your team has modified from the generated defaults. A major version that regenerates these files can conflict with local changes, and the conflict is invisible unless someone reads the local diffs first.
| Configuration artifact | Why it matters | Review action |
|---|---|---|
config/initializers/* |
Application-specific setup | Compare against generated defaults |
config/application.rb |
Framework configuration | Check for settings the new version moved |
config/environments/* |
Per-environment settings | Check for settings the new version changed |
| Generated framework files | Updated by the upgrade | Regenerate and review the diff |
Every row of the table is initializer inventory. Each row is a place where your application and the framework meet, and each is a candidate for a conflict during a major bump. The Rails configuring guide is the reference for what the configuration options are, and it is the evidence for whether a setting moved. Derived, F058: Separating framework steps, initializer changes, dependency constraints, and application edits into stages is an editorial staging method built on the official guides. The sequence is not an official universal order, and a specific application may need a different one.
Map Dependency Constraints
The Gemfile is where Rails and its dependencies meet your application. A major Rails version constrains which gem versions are compatible, and the constraints run in both directions: Rails constrains its dependencies, and your gems constrain Rails.
grep -n "rails" Gemfile
# find the rails gem line and its version constraint
bundle outdated
# see which dependencies are behind before the bumpThe review question for dependencies is who constrains whom. A gem that pins Rails to the old major will block the bump. A gem that requires a Ruby version your target does not support will block the bump. Both are constraints to resolve before the framework changes land.
| Constraint | Direction | Review action |
|---|---|---|
| Rails gem version | Your choice | Set the target major in the Gemfile |
| Gem depending on Rails | Gem constrains Rails | Check each Rails-dependent gem’s compatibility |
| Ruby version | Rails constrains Ruby, Ruby constrains gems | Resolve separately from Rails policy |
| Transitive gem conflicts | Bundler resolution | Let the resolver surface them, then read them |
Approach the table as constraint map. The Ruby row is the one the guardrail protects: Rails support policy and Ruby support policy are separate, and resolving a Ruby constraint is not the same step as resolving a Rails one. The Gradle constraints guide applies the same distinction to the JVM: a constraint influences resolution without adding an edge, and reading the constraint is different from changing it.
Sequence Framework Changes
Framework changes are the steps the upgrading guide lists for the target version. They are the stage that comes before application edits, because the framework’s new behavior is what the application edits have to be reviewed against.
rails app:update
# the task the upgrading guide describes for updating application files
git diff
# review the generated changes before accepting themThe framework stage is reviewable when each step the guide lists is confirmed separately. A step that generates new files produces a diff to review. A step that changes a default produces a behavior change to confirm. Bundling them produces the unattributable diff this post is about avoiding.
| Framework step | What it changes | Review action |
|---|---|---|
| Update application files | Initializers and config | Review the generated diff |
| New defaults | Framework behavior | Confirm the new default is acceptable |
| Removed behavior | What stopped working | Confirm the application does not depend on it |
Use the table as a staging checklist. The last row is the one that connects to the application stage, because removed behavior is what forces application edits. Naming it in the framework stage makes the application stage’s work visible before it starts.
The Angular update guide applies the same staging discipline to Angular: treat the guide’s steps as ordered evidence to review, and separately record the manual work the framework’s steps do not cover.
Review Application Edits
Application edits are the last stage. They are the changes your code needs because the framework’s behavior changed, and they are reviewable only once the framework stage is settled.
git diff --stat app lib
# the application edits, separated from the framework diff
rails test
# the pass condition for the application stageThe review question for application edits is attribution. Each edit should trace to a framework change: a renamed method, a changed default, a removed behavior. An application edit that traces to nothing is either a drive-by change or a fix for a stage that was not really settled, and both are findings before merge.
| Application edit | Traces to | Review action |
|---|---|---|
| Renamed method call | A framework rename | Confirm the rename is complete |
| Changed default handling | A new framework default | Confirm the new behavior is intended |
| Removed behavior replacement | A framework removal | Confirm the replacement covers your usage |
The table works as attribution check. Every application edit should land in a row, and an edit that matches no row is worth a second look. The Claude Code overengineering guide describes the bundled-upgrade diff this staging exists to prevent. The Claude Code legacy code guide covers characterization tests for old code paths, and a major upgrade is the moment those tests earn their keep: they describe what the code did before the bump, which is the evidence a reviewer needs when behavior changes.
Rails upgrade stage checklist
The checklist is the artifact worth keeping. The checklist is that sequence written down, with each stage’s pass condition, so the next upgrade starts from a plan rather than from a version number and a hope.
| Stage | Work | Pass condition |
|---|---|---|
| Read | Upgrading guide and maintenance policy for the target version | Steps and policy cited from the current pages |
| Inventory | Initializers, config files, and local modifications listed | Every modified file is named |
| Constraints | Gemfile and Ruby version constraints mapped | Every blocking constraint is resolved or named |
| Framework | Steps from the upgrading guide | Generated diff reviewed, new defaults confirmed |
| Application | Edits the framework changes require | Every edit traces to a framework change |
| Confirm | Full test run on the target version | Tests pass and no stage was skipped |
Use the table as runbook. Every stage has a pass condition, and the stages are ordered so that a failure points at the stage that introduced it. The read stage cites its sources because F057 requires it: the maintenance text was only partly verifiable during research, and a plan that does not cite its policy page cannot be checked. The same staging discipline appears in Rails’ own release history, which is the evidence for what changed between versions. Reading it alongside the upgrading guide is what makes the framework stage derived from the target version rather than from memory.
Initializer change inventory
An initializer inventory is the artifact that makes the framework stage reviewable. Each row records an initializer, whether your team modified it, and what the upgrade did to it.
| Initializer | Team-modified | Upgrade effect | Review note |
|---|---|---|---|
| A generated default your team changed | Yes | Regenerated with new defaults | Local changes may conflict |
| A generated default your team did not change | No | Regenerated | Accept the new default |
| An application-specific initializer | Custom | Not regenerated | Review for settings the framework moved |
Every row of the table is conflict map. The first row is where upgrades hurt, because a regenerated default can overwrite a local change. Recording which initializers the team modified is the check that prevents that conflict from reaching a build. The inventory also makes the agent conversation concrete. When Claude Code runs the upgrade task, the review question is whether the generated diff respected the team’s local changes, and the inventory is the evidence for that review. The Claude Code verification guide covers the questions to ask before accepting a generated diff.
Handling a failed stage
A staged upgrade earns its keep when a stage fails. The failure points at the stage, and the fix belongs to that stage rather than to the whole bump. Working the failure is a review activity, and it is where the staging discipline pays back the extra rounds.
Three failure shapes cover most of what goes wrong. A framework-stage failure means a step from the upgrading guide did not land cleanly, and the fix is in that step. A constraint-stage failure means a gem or a Ruby version blocked the resolution, and the fix is in the Gemfile or the Ruby version. An application-stage failure means a behavior change reached code that depended on the old behavior, and the fix is in the application.
| Failed stage | Likely cause | Where the fix belongs |
|---|---|---|
| Framework | A guide step did not apply cleanly | Re-run or hand-apply that step |
| Constraints | A gem or Ruby version blocked resolution | Resolve the constraint, not the symptom |
| Application | A behavior change broke a call site | Fix the call site against the new behavior |
| Confirm | Tests fail with no stage implicated | Re-check that earlier stages truly passed |
Treat the table as a debugging aid. The last row is the one that catches a skipped stage: a confirm-stage failure with no implicated stage usually means an earlier pass condition was treated as satisfied when it was not. The Claude Code false success guide describes that pattern generally, and a staged upgrade is where it costs the most.
The Claude Code verification guide covers the questions to ask when a stage claims to be done, and a per-stage pass condition is exactly the kind of claim that needs evidence rather than a green command. Recording which stage a failure came from is also what makes the next upgrade cheaper, because the failure history becomes part of the runbook.
New framework defaults need a decision
A major Rails version changes defaults. A default that was opt-in becomes opt-out, or a behavior that was lenient becomes strict. Each change is a decision the upgrade hands you, and treating it as automatic is how a behavior regression reaches production.
Three default changes cover most of the surface. A new configuration default changes how the framework behaves for code that did not set the option. A removed deprecation default changes what happens to code that relied on the deprecated path. A new security or parameter default changes what the application accepts. Each needs a yes or a no, and the upgrading guide is where the change is documented.
| Default change | What it affects | Decision to make |
|---|---|---|
| New configuration default | Framework behavior for unset options | Adopt or override |
| Removed deprecation fallback | Code on the deprecated path | Migrate the code |
| New security default | What requests are accepted | Confirm callers comply |
Read the table as a decision list. Every row is a default that changed, and each needs an explicit adoption or an explicit override. Leaving it undecided means the new behavior applies silently, which is a decision made by omission. The Cargo Profile Boundaries guide applies the same separation to Rust build profiles: a setting that changes observable behavior deserves a decision rather than a default.
The concrete win, loss, and implication
The concrete win is an upgrade you can attribute. When a test fails after the bump, the stage that introduced it is named, and the fix belongs to that stage. That property is what makes a major upgrade reviewable.
The concrete loss is that the policy evidence is version-sensitive and only partly verifiable. The maintenance page redirected during research and the guide pages were not fetched, so a plan built from this post must cite the current maintenance page and the current upgrading guide before it relies on support dates or policy categories.
The practical implication is that stages are the unit of review for a framework upgrade. Teams that sequence framework steps, initializer changes, dependency constraints, and application edits spend less time untangling bundled diffs. Teams that do it in one pass keep rediscovering the same unattributable failure on every major bump.
Working with Claude Code on an upgrade
Give the agent three inputs: the version you run and the version you target, the commands it may run, and the definition of done. The definition of done is a staged checklist with each stage’s pass condition, not a single green build.
rails app:update
# ask for the generated diff before accepting it
git diff --stat
# ask for the diff shape, then attribute each stageReview the agent’s staging claim. The agent can run the upgrade task accurately and still produce a bundled diff, because running everything at once is the shortest path to a finished-looking change. Deciding whether a stage is settled is a review decision, and the reviewer owns it. The Claude Code cost per verified change guide is the lens for how much verification a staged upgrade deserves.
An upgrade that turns into a wide application rewrite deserves a pause. The Claude Code parallel agents guide covers isolating concurrent work, and upgrade stages are the kind of change where two agents in one diff fight over attribution.
Checklist before you bump
| Check | Pass condition | If it fails |
|---|---|---|
| Versions named | The version you run and the target are recorded | Name both before planning |
| Upgrading guide read | Steps for the target version are listed | Read the guide for that version |
| Maintenance policy cited | The current maintenance page is cited | Do not rely on remembered dates |
| Ruby policy separated | Ruby support is a separate row | Keep Rails and Ruby policy apart |
| Initializers inventoried | Every initializer and local change is named | List them before the bump |
| Constraints mapped | Rails, gem, and Ruby constraints resolved or named | Read the Gemfile and resolver output |
| Framework stage settled | Generated diff reviewed, defaults confirmed | Settle the framework before application edits |
| Application edits attributed | Every edit traces to a framework change | Review unattributed edits before merge |
Data gap and future update
The Rails maintenance page redirected during research and the upgrading guide, maintenance policy guide, release history, and configuring guide were not fetched. F057 is official in its broad claim that these are the official references, and the specific policy wording, support dates, and version-specific steps must be rechecked against the current pages before a plan relies on them.
No support date, policy category, or version-specific step is stated in this post that is not attributed to the guides. The guardrail against inventing support dates applies to any later edit. A future update producing a version-by-version step table would need a fetch of each version’s upgrading guide, and no such table was built here.
Ruby support policy is out of scope beyond noting that it is separate. Whether a specific Ruby version is supported is a property of Ruby’s own policy, and this post does not merge the two or state Ruby dates.
Related reading on framework maintenance and upgrade sequencing
Framework maintenance appears across this batch. Django Deprecation Runway covers building a deprecation inventory from official evidence. Angular Update Guide covers producing a project-specific migration checklist from guide inputs.
Dependency and constraint boundaries that surround a Rails bump appear in Gradle Constraints vs Dependencies, Gradle Capability Conflicts, Maven Optional Dependencies, and pnpm Peer Diagnostics. Configuration and metadata boundaries appear in Cargo Workspace Inheritance and CMake Presets.
More from this batch
- pnpm Peer Diagnostics: Read Resolution Reports Before Claude Code Pins
- TypeScript Project References: A Claude Code Boundary Guide
- OpenAPI Generator Customization: Keep Templates and Config in Sync
- GraphQL Code Generator Client Presets: Review Generated Boundaries
- Protocol Buffer Reserved Fields: A Claude Code Wire Compatibility Guide
- sqlc Query Annotations: Align SQL and Generated Types With Claude Code
- Django Deprecation Runway: Plan Framework Maintenance With Claude Code
- Angular Update Guide: Build a Migration Plan With Claude Code
- Go Module Compatibility: Keep API Changes Inside the Contract
- Cargo Profile Boundaries: Keep Debug and Release Behavior Aligned
One AI API Key option for OpenAI-format agents
Claude Code uses an Anthropic-format route, so the One AI free model IDs are not a Claude Code model source. The packet records Claude IDs as unavailable on 2026-11-27.
OpenAI-format agents have a separate route: One AI API Key offers https://api.oneaiapikey.com/v1, one key, and 46 live free IDs. Free IDs are a different client and request format, not a workaround for Claude Code authentication. Check the free model list before choosing an agent route, or read the quickstart for the request shape.
FAQ
Can I do the whole Rails upgrade in one commit?
You can, and it is the diff nobody can review. A bundled upgrade mixes framework behavior, initializer regeneration, dependency resolution, and application edits. Staging them keeps each change attributable, and a failure points at the stage that introduced it rather than at the whole bump.
Does the upgrading guide tell me my support window?
The upgrading guide covers steps. The maintenance policy covers support. Read both, and cite the current maintenance page directly, because the policy text was only partly verifiable during research and this post does not state support dates.
Is a generated initializer safe to accept?
Not automatically. A regenerated initializer can overwrite a change your team made. Inventory which initializers are team-modified before running the upgrade task, and review the generated diff against that inventory.
Does fixing a Rails constraint also fix my Ruby constraint?
No. Rails support policy and Ruby support policy are separate documents with separate dates. A Rails version that requires a newer Ruby does not make that Ruby version supported, and resolving the two is a separate step.
What proves an upgrade stage is complete?
Its pass condition. The framework stage is complete when the generated diff is reviewed and new defaults confirmed. The application stage is complete when every edit traces to a framework change and the test run passes. A single green build at the end is not a substitute for the per-stage conditions.
More Claude Code troubleshooting
- Python Dependency Groups vs Extras: A Claude Code Migration Map
- Python Protocols vs ABCs: Preserve Interface Contracts With Claude Code
- Python TypedDict Boundaries: Stop Model Drift With Claude Code
- Python Stub Drift: Audit Third-Party Types With Claude Code
- Go Workspace Boundaries: Decide What Belongs in go.work
- Go Module Graph Pruning: Explain Indirect Dependencies With Claude Code
- Cargo Feature Unification: Control Optional APIs With Claude Code
- Cargo Build Scripts: Define Generated-Artifact Contracts for Claude Code
- Gradle Variant Attributes: Match Consumers to the Right Artifact
- NuGet Central Package Management: Plan a Cross-Project Migration
- .NET Multi-Targeting: Separate Framework Dependencies for Claude Code
- C# Source Generators: Review Generated Contracts With Claude Code
- CMake find_package vs FetchContent: Choose a Dependency Boundary
- Conan CMakeDeps: Keep Consumer Targets Stable for Claude Code
Sources
- Official: Rails Maintenance Policy Page, the official maintenance reference. Redirected during research; recheck policy text before relying on it (F057 caveat).
- Official: Rails Guide: Upgrading Ruby on Rails, the official reference for major-version upgrade steps (F057). Not fetched this pass.
- Official: Rails Guide: Maintenance Policy, reference for support policy. Not fetched this pass.
- Official: Rails Official Releases, reference for what changed between versions. Not fetched this pass.
- Official: Rails Guide: Configuring Rails Applications, reference for configuration options behind initializer changes (F058 context). Not fetched this pass.
- Official: Claude Code Docs: Best Practices, supporting the staged review loop.