Skip to content

ombulabs/claude-code_rails-upgrade-skill / rails-upgrade

rails-upgrade

Verified

Analyzes Rails applications and generates comprehensive upgrade reports with breaking changes, deprecations, and step-by-step migration guides for Rails 2.3 through 8.1. Use when upgrading Rails applications, planning multi-hop upgrades, querying version-specific changes, or answering what stands between the app and the next Rails version. Based on FastRuby.io methodology and "The Complete Guide to Upgrade Rails" ebook.

FileKindSize
SKILL.mdskill md11.0 KB
detection-scripts/gem_limits.rbscript6.0 KB
detection-scripts/hop.rbscript2.2 KB
detection-scripts/patterns/rails-40-patterns.expectations.ymlconfig43.8 KB
detection-scripts/patterns/rails-40-patterns.ymlconfig96.5 KB
detection-scripts/patterns/rails-41-patterns.expectations.ymlconfig25.6 KB
detection-scripts/patterns/rails-41-patterns.ymlconfig59.8 KB
detection-scripts/patterns/rails-42-patterns.expectations.ymlconfig27.5 KB
detection-scripts/patterns/rails-42-patterns.ymlconfig48.7 KB
detection-scripts/patterns/rails-50-patterns.expectations.ymlconfig1.9 KB
detection-scripts/patterns/rails-50-patterns.ymlconfig8.1 KB
detection-scripts/patterns/rails-51-patterns.expectations.ymlconfig4.2 KB
detection-scripts/patterns/rails-51-patterns.ymlconfig15.0 KB
detection-scripts/patterns/rails-52-patterns.expectations.ymlconfig5.0 KB
detection-scripts/patterns/rails-52-patterns.ymlconfig14.7 KB
detection-scripts/patterns/rails-60-patterns.expectations.ymlconfig1007 B
detection-scripts/patterns/rails-60-patterns.ymlconfig14.2 KB
detection-scripts/patterns/rails-70-patterns.expectations.ymlconfig4.0 KB
detection-scripts/patterns/rails-70-patterns.ymlconfig11.2 KB
detection-scripts/patterns/rails-71-patterns.expectations.ymlconfig3.1 KB
detection-scripts/patterns/rails-71-patterns.ymlconfig9.5 KB
detection-scripts/patterns/rails-72-patterns.expectations.ymlconfig1.2 KB
detection-scripts/patterns/rails-72-patterns.ymlconfig6.1 KB
detection-scripts/patterns/rails-80-patterns.expectations.ymlconfig6.6 KB
detection-scripts/patterns/rails-80-patterns.ymlconfig21.2 KB
detection-scripts/patterns/rails-81-patterns.expectations.ymlconfig4.3 KB
detection-scripts/patterns/rails-81-patterns.ymlconfig13.2 KB
detection-scripts/scan_patterns.rbscript42.8 KB
examples/multi-hop-upgrade.mdmarkdown18.9 KB
examples/simple-upgrade.mdmarkdown4.0 KB
references/breaking-changes-by-version-reference.mdmarkdown3.9 KB
references/deprecation-warnings-reference.mdmarkdown10.7 KB
references/gem-compatibility-reference.mdmarkdown8.2 KB
references/js-compressor-sprockets-mismatch-reference.mdmarkdown4.7 KB
references/multi-hop-strategy-reference.mdmarkdown8.8 KB
references/next-hop-readiness-reference.mdmarkdown2.1 KB
references/no-test-suite-smoke-reference.mdmarkdown4.7 KB
references/request-patterns-reference.mdmarkdown3.7 KB
references/sequential-strategy-reference.mdmarkdown2.1 KB
references/staying-current-reference.mdmarkdown7.8 KB
references/testing-checklist-reference.mdmarkdown6.3 KB
templates/app-update-preview-template.mdmarkdown4.3 KB
templates/upgrade-report-template.mdmarkdown10.2 KB
version-guides/upgrade-3.2-to-4.0.mdmarkdown68.0 KB
version-guides/upgrade-4.0-to-4.1.mdmarkdown66.7 KB
version-guides/upgrade-4.1-to-4.2.mdmarkdown60.7 KB
version-guides/upgrade-4.2-to-5.0.mdmarkdown9.7 KB
version-guides/upgrade-5.0-to-5.1.mdmarkdown19.1 KB
version-guides/upgrade-5.1-to-5.2.mdmarkdown17.7 KB
version-guides/upgrade-5.2-to-6.0.mdmarkdown6.4 KB
version-guides/upgrade-6.0-to-6.1.mdmarkdown6.8 KB
version-guides/upgrade-6.1-to-7.0.mdmarkdown14.7 KB
version-guides/upgrade-7.0-to-7.1.mdmarkdown13.2 KB
version-guides/upgrade-7.1-to-7.2.mdmarkdown11.2 KB
version-guides/upgrade-7.2-to-8.0.mdmarkdown23.1 KB
version-guides/upgrade-8.0-to-8.1.mdmarkdown14.0 KB
workflows/00-verify-latest-patch-workflow.mdmarkdown1.7 KB
workflows/01-run-test-suite-workflow.mdmarkdown12.7 KB
workflows/02-resolve-deprecation-warnings-workflow.mdmarkdown6.3 KB
workflows/03-validate-upgrade-path-workflow.mdmarkdown1.8 KB
workflows/04-setup-next-rails-workflow.mdmarkdown1.5 KB
workflows/05-detect-breaking-changes-workflow.mdmarkdown20.0 KB
workflows/06-check-gem-compatibility-workflow.mdmarkdown11.1 KB
workflows/07-boot-smoke-test-workflow.mdmarkdown7.3 KB
workflows/08-generate-upgrade-report-workflow.mdmarkdown12.7 KB
workflows/09-generate-app-update-preview-workflow.mdmarkdown7.3 KB
workflows/10-implement-and-upgrade-workflow.mdmarkdown2.5 KB
workflows/11-sync-ci-workflow.mdmarkdown8.6 KB
workflows/12-align-load-defaults-workflow.mdmarkdown952 B
workflows/13-mention-cleanup-workflow.mdmarkdown1.3 KB

version-guides/upgrade-7.2-to-8.0.md

View on GitHub
# Rails 7.2 → 8.0 Upgrade Guide

**Ruby Requirement:** 3.2.0+ (required)

---

## Overview

Rails 8.0 is a major release with architectural changes:
- **Propshaft** replaces Sprockets as default asset pipeline
- **Solid Cache/Queue/Cable** as database-backed defaults
- **Kamal** for deployment
- **Thruster** for production HTTP serving
- **No more PaaS mode** - designed for containerized deployment

---

## Breaking Changes

### ðŸ”ī HIGH PRIORITY

#### Sprockets → Propshaft

**Pattern:** `SPROCKETS`, `ASSET_CONFIG`, `JS_INCLUDE`

**What Changed:**
Propshaft is the new default asset pipeline. Sprockets is no longer included by default.

**Detection Pattern:**
```ruby
# Gemfile
gem 'sprockets-rails'
gem 'sassc-rails'

# Config
config.assets.compile = true
config.assets.digest = true
```

**Migration Options:**

**Option A: Keep Sprockets (Simplest)**
```ruby
# Gemfile - explicitly keep Sprockets
gem 'sprockets-rails'
gem 'sassc-rails'  # if using Sass
```

This is fine! Sprockets still works.

**Option B: Migrate to Propshaft (Recommended for new features)**
```ruby
# Gemfile
gem 'propshaft'

# Remove
# gem 'sprockets-rails'
# gem 'sassc-rails'
```

**Propshaft Differences:**
- No asset compilation transforms
- Direct serving from `app/assets/`
- Use `cssbundling-rails` for Sass
- Simpler configuration

```ruby
# Remove these Sprockets configs
# config.assets.compile
# config.assets.digest
# config.assets.debug
```

**Asset Helpers:**
```erb
<!-- Both work the same -->
<%= stylesheet_link_tag 'application' %>
<%= javascript_include_tag 'application' %>
```

---

#### assume_ssl Configuration

**Pattern:** `ASSUME_SSL`

**What Changed:**
Rails 8.0 introduces `config.assume_ssl` for apps behind SSL-terminating proxies.

**Detection Pattern:**
```ruby
# config/environments/production.rb
config.force_ssl = true
```

**Fix:**
```ruby
# config/environments/production.rb
config.force_ssl = true
config.assume_ssl = true  # Add this for load balancers
```

This prevents SSL redirect loops when behind a proxy.

---

#### sqlite3_deprecated_warning Removed

**Pattern:** `SQLITE3_WARNING`

**What Changed:**
The `sqlite3_deprecated_warning` configuration option is removed.

**Detection Pattern:**
```ruby
config.active_record.sqlite3_deprecated_warning = false
```

**Fix:**
Remove this line from your configuration files.

---

#### Ruby 3.2+ Strictly Required

**Pattern:** `RUBY_VERSION`

**What Changed:**
Rails 8.0 requires Ruby 3.2.0 or newer: the `rails` 8.0 gemspec sets `required_ruby_version >= 3.2.0`, while 7.2 accepts `>= 3.1.0`. Bundler refuses to install 8.0 on an older Ruby, so upgrade Ruby first, while the app is still on Rails 7.2, as its own deploy. The gemspec sets no upper bound; a Ruby released after a Rails version may need that version's latest patch release.

**Detection Pattern:**
```ruby
# Gemfile
ruby "3.1.6"

# .ruby-version
3.1.6

# .tool-versions
ruby 3.1.6
```

**Fix:**
```bash
rbenv install 3.3.0
rbenv local 3.3.0
```

---

#### `query_constraints:` association option removed (composite foreign keys)

**Pattern:** `QUERY_CONSTRAINTS_OPTION`

**What Changed:**
Rails 8.0 **removes** the `query_constraints:` option on associations (`belongs_to`/`has_many`/etc.). It was deprecated in Rails 7.2 and now raises `ActiveRecord::ConfigurationError` **at class load**, so the app fails to boot.

**Detection Pattern:**
```ruby
# app/models/*.rb
belongs_to :activity, query_constraints: [:activity_id, :school_id]
```

**Error (Rails 8.0):**
```
ActiveRecord::ConfigurationError:
  Setting `query_constraints:` option on `ActivityParticipant.belongs_to :activity`
  is not allowed. To get the same behavior, use the `foreign_key` option instead.
```

**Fix — pass the composite key as an `Array` to `foreign_key:`:**
```ruby
# BEFORE (7.2 deprecation → 8.0 raises)
belongs_to :activity, query_constraints: [:activity_id, :school_id]

# AFTER (works on Rails 7.2 AND 8.0)
belongs_to :activity, foreign_key: [:activity_id, :school_id]
```

This is **behavior-preserving and version-agnostic**: when `foreign_key:` is given an `Array`, ActiveRecord internally maps it back to `query_constraints` (in both 7.2 and 8.0), so no dual-boot (`NextRails.next?`) branch is needed. On 7.2 it also silences the deprecation warning.
  
> ⚠ïļ Not in the official Rails Upgrade Guide or the 7.2/8.0 release notes — documented only in `activerecord` `CHANGELOG.md` (7.2) and the source. A **boot smoke test** (`bin/rails runner`) is the reliable way to catch it.

---

#### `enum` Keyword-Arguments Form Removed

**Pattern:** `ENUM_KWARGS`

**What Changed:**
Rails 7.2 accepted `enum status: { ... }, _prefix: true` with a deprecation warning. Rails 8.0 makes the enum name a required positional argument (`def enum(name, values = nil, **options)`), so the keyword form raises `ArgumentError: wrong number of arguments (given 0, expected 1..2)` when the model loads.

**Detection Pattern:**
```ruby
# app/models/*.rb
enum status: { active: 0, archived: 1 }, _prefix: true
```

**Fix:**
```ruby
# BEFORE
enum status: { active: 0, archived: 1 }, _prefix: true

# AFTER
enum :status, { active: 0, archived: 1 }, prefix: true
```
The AFTER works on 7.2 too. Drop the leading underscore from the options (`_prefix`, `_suffix`, `_scopes`, `_default`): the positional form raises `ArgumentError: invalid option(s)` on both versions if it is kept.

---

#### Removed Active Record Config Keys Raise NoMethodError

**Pattern:** `WARN_ON_RECORDS_FETCHED`, `ALLOW_DEPRECATED_SINGULAR_ASSOCIATIONS_NAME`, `COMMIT_TRANSACTION_ON_NON_LOCAL_RETURN`

**What Changed:**
Rails 8.0 removes three Active Record settings that 7.2 still accepted with a deprecation warning. The railtie copies each `config.active_record.*` value onto `ActiveRecord::Base` when it loads, so a leftover line raises `NoMethodError: undefined method '<key>=' for class ActiveRecord::Base` at boot with eager loading, otherwise on the first model access. On 7.2, `allow_deprecated_singular_associations_name` and `commit_transaction_on_non_local_return` already do nothing (a `return`, `break` or `throw` out of a transaction block commits); `warn_on_records_fetched_greater_than` still logs large result sets.

**Detection Pattern:**
```ruby
# config/application.rb, config/environments/*.rb, config/initializers/*.rb
config.active_record.warn_on_records_fetched_greater_than = 1000
config.active_record.allow_deprecated_singular_associations_name = false
config.active_record.commit_transaction_on_non_local_return = true
```

**Fix:**
```ruby
# BEFORE
config.active_record.warn_on_records_fetched_greater_than = 1000

# AFTER (line deleted; to keep the check, watch the row count)
ActiveSupport::Notifications.subscribe("sql.active_record") do |*, payload|
  Rails.logger.warn("Large result: #{payload[:sql]}") if payload[:row_count].to_i > 1000
end
```
Deleting the lines works on 7.2 too, and so does the subscriber: both versions put `row_count` in the `sql.active_record` payload.

---

### ðŸŸĄ MEDIUM PRIORITY

#### Multi-Database Configuration for Solid Gems

**Pattern:** `DB_POOL`

**What Changed:**
Rails 8.0 changes nothing in how `database.yml` is read: a single `production:` block and the `pool:` key work as they did on 7.2. What changed is the 8.0 app generator, which splits `production:` into `primary`, `cache`, `queue` and `cable` databases, each with its own `migrations_paths`, for Solid Cache, Solid Queue and Solid Cable. Change the file only when adopting those gems.

**Detection Pattern:**
```yaml
# config/database.yml
production:
  adapter: postgresql
  database: myapp_production
  pool: 5
```

**Fix (only if adopting Solid gems):**
```yaml
# BEFORE
production:
  <<: *default
  database: myapp_production

# AFTER (same shape as the 8.0 generator)
production:
  primary: &primary_production
    <<: *default
    database: myapp_production
  cache:
    <<: *primary_production
    database: myapp_production_cache
    migrations_paths: db/cache_migrate
  queue:
    <<: *primary_production
    database: myapp_production_queue
    migrations_paths: db/queue_migrate
  cable:
    <<: *primary_production
    database: myapp_production_cable
    migrations_paths: db/cable_migrate
```
The AFTER works on 7.2 too. If the app keeps Redis, Sidekiq or its current cache store, leave `database.yml` as it is.

---

#### Solid Cache (Optional)

**Pattern:** `REDIS_CACHE`

**What Changed:**
Rails 8.0 defaults to Solid Cache for caching (database-backed).

**Detection Pattern:**
```ruby
config.cache_store = :redis_cache_store
config.cache_store = :mem_cache_store
```

**Options:**

**Keep Redis/Memcached:**
```ruby
# No change needed - your existing setup still works
config.cache_store = :redis_cache_store, { url: ENV['REDIS_URL'] }
```

**Switch to Solid Cache:**
```ruby
# Gemfile
gem 'solid_cache'

# Install
rails solid_cache:install

# Config
config.cache_store = :solid_cache_store
```

---

#### Solid Queue (Optional)

**Pattern:** `SIDEKIQ_QUEUE`

**What Changed:**
Rails 8.0 defaults to Solid Queue for background jobs (database-backed).

**Detection Pattern:**
```ruby
config.active_job.queue_adapter = :sidekiq
config.active_job.queue_adapter = :async
```

**Options:**

**Keep Sidekiq:**
```ruby
# No change needed
config.active_job.queue_adapter = :sidekiq
```

**Switch to Solid Queue:**
```ruby
# Gemfile
gem 'solid_queue'

# Install
rails solid_queue:install

# Config
config.active_job.queue_adapter = :solid_queue

# Start the supervisor; without it jobs stay pending
bin/jobs
```

---

#### Solid Cable (Optional)

**Pattern:** `CABLE_REDIS`

**What Changed:**
Rails 8.0 defaults to Solid Cable for WebSockets (database-backed).

**Detection Pattern:**
```yaml
# config/cable.yml
production:
  adapter: redis
```

**Options:**

**Keep Redis:**
```yaml
# No change needed
production:
  adapter: redis
  url: <%= ENV.fetch("REDIS_URL") %>
```

**Switch to Solid Cable:**
```yaml
production:
  adapter: solid_cable
  polling_interval: 0.1.seconds
```

---

#### Docker/Thruster for Production

**Pattern:** `THRUSTER`

**What Changed:**
Rails 8.0 apps include Dockerfile and Thruster gem.

**Fix:**
If using Docker, add:
```ruby
# Gemfile
gem 'thruster'
```

Thruster provides:
- HTTP/2 support
- Asset compression
- Static file serving

---

#### Kamal Deployment

**Pattern:** `KAMAL_DEPLOY`

**What Changed:**
Rails 8.0 includes Kamal configuration for deployment.

**New Files:**
- `config/deploy.yml`
- `.kamal/` directory

**If not using Kamal**, you can ignore or delete these files.

---

#### to_time Preserves the Full Timezone

**Pattern:** `TO_TIME_PRESERVES_TIMEZONE`, `TO_TIME_PRESERVES_TIMEZONE_ASSIGNMENT`

**What Changed:**
Rails 8.0 warns whenever `to_time_preserves_timezone` is set to anything other than `:zone`, because 8.1 makes `:zone` the only behavior. `load_defaults 8.0` sets `:zone`. `load_defaults` 5.0 to 7.2 leave it at `:offset` on 8.0 (7.2 stores the same setting as `true`), so an app still on an older `load_defaults` warns at boot:

```
DEPRECATION WARNING: `to_time` will always preserve the full timezone rather than offset of the receiver in Rails 8.1.
To opt in to the new behavior, set `config.active_support.to_time_preserves_timezone = :zone`.
```

An app with no `load_defaults` line gets `false` and a different message (`... preserve the receiver timezone rather than system local time in Rails 8.1`).

An explicit assignment keeps warning even after `load_defaults 8.0`, because the setter itself warns. The usual source is the forward-compat initializer the Rails 4.2 generator added, `config/initializers/to_time_preserves_timezone.rb`.

**Detection Pattern:**
```ruby
# config/application.rb
config.load_defaults 7.2

# config/initializers/to_time_preserves_timezone.rb (or any file under config/)
ActiveSupport.to_time_preserves_timezone = true
config.active_support.to_time_preserves_timezone = :offset
```

**Fix:**
```ruby
# BEFORE
# config/initializers/to_time_preserves_timezone.rb
ActiveSupport.to_time_preserves_timezone = true

# AFTER
# Delete the file. load_defaults 5.0+ already sets this on 7.2, and on 8.0
# the after_initialize hook overwrites a direct assignment with the config value.
```

```ruby
# BEFORE (warns on 8.0)
# config/application.rb
config.load_defaults 7.2

# AFTER (opts in to this one setting; 7.2 accepts :zone, so no NextRails.next? branch)
config.load_defaults 7.2
config.active_support.to_time_preserves_timezone = :zone
```

This flag is the default fix because it targets this one deprecation. Aligning `load_defaults` to 8.0 also removes the warning, but it flips every other 8.0 default at the same time, so treat it as the follow-up in Workflow 12, which moves `load_defaults` one setting at a time after the upgrade ships. Once `load_defaults 8.0` is in place, the explicit line is redundant: delete it then, because 8.1 deprecates the setting itself.

On 8.0 `:zone` is a behavior change: `to_time` returns a Time that carries the receiver's full zone (DST-aware) instead of a fixed UTC offset. Run the suite after adding the line.

---

#### Routes Drawn With Multiple Paths Deprecated

**Pattern:** `ROUTES_MULTIPLE_PATHS`

**What Changed:**
Rails 7.2 accepts several paths in one route call (`get "/old1", "/old2", to: "foo#bar"`) with no warning. Rails 8.0 still draws every route but warns at boot, once per call:

```
DEPRECATION WARNING: Mapping a route with multiple paths is deprecated and will be removed in Rails 8.1. Please use multiple method calls instead.
```

An Array path (`get ["/old1", "/old2"], ...`) is a different shape: it draws no route at all on 7.2 or 8.0.

**Detection Pattern:**
```ruby
# config/routes.rb
get "/old1", "/old2", to: "foo#bar"
get :search, :filter
```

**Fix:**
```ruby
# BEFORE
get "/old1", "/old2", to: "foo#bar"

# AFTER
get "/old1", to: "foo#bar"
get "/old2", to: "foo#bar"
# or: %w[/old1 /old2].each { |path| get path, to: "foo#bar" }
```
The AFTER works on 7.2 too.

---

### ðŸŸĒ LOW PRIORITY

#### read_encrypted_secrets Removed

**Pattern:** `READ_ENCRYPTED_SECRETS`

**What Changed:**
Rails 8.0 removes `config.read_encrypted_secrets`. The setting drove the legacy `config/secrets.yml.enc` feature, already dead since 7.2 removed `Rails.application.secrets`. The assignment does not raise on 8.0: it is stored with no effect and no warning. Only the 7.2 side of a dual boot warns, which clutters boot and `assets:precompile` logs:

```
DEPRECATION WARNING: 'config.read_encrypted_secrets=' is deprecated and will be removed in Rails 8.0.
```

Reading `config.read_encrypted_secrets` without assigning it first raises `NoMethodError` on 8.0.

**Detection Pattern:**
```ruby
# config/environments/production.rb
config.read_encrypted_secrets = true
```

**Fix:**
```ruby
# BEFORE
# Attempt to read encrypted secrets from `config/secrets.yml.enc`.
config.read_encrypted_secrets = true

# AFTER
# (line and comment deleted; safe on both 7.2 and 8.0)
```

If the app still keeps secrets in `config/secrets.yml.enc`, move them to credentials (`bin/rails credentials:edit`) first.

---

#### `SCHEMA_CACHE` Environment Variable No Longer Read

**Pattern:** `ENV_SCHEMA_CACHE`

**What Changed:**
Rails 7.1 used `ENV["SCHEMA_CACHE"]` as the path for `db:schema:cache:dump` and the schema cache load. Rails 7.2 already ignores it and only warns; 8.0 removes the warning too, so the variable is ignored silently and the default `db/schema_cache.yml` (or `db/<name>_schema_cache.yml`) is used. Nothing raises: a script or CI step that sets it has been using the default path since 7.2.

```
DEPRECATION WARNING: Setting `ENV["SCHEMA_CACHE"]` is deprecated and will be removed in Rails 8.0. Configure the `:schema_cache_path` in the database configuration instead.
```

**Detection Pattern:**
```ruby
ENV["SCHEMA_CACHE"] = "tmp/schema_cache.yml"
# CI step or script
SCHEMA_CACHE=tmp/schema_cache.yml bin/rails db:schema:cache:dump
```

**Fix:**
```yaml
# BEFORE
SCHEMA_CACHE=tmp/schema_cache.yml bin/rails db:schema:cache:dump

# AFTER
# config/database.yml
production:
  <<: *default
  schema_cache_path: tmp/schema_cache.yml
```
The AFTER works on 7.2 too.

---

#### `unsigned_float` and `unsigned_decimal` Column Methods Deprecated

**Pattern:** `UNSIGNED_FLOAT_DECIMAL`

**What Changed:**
The MySQL adapter's `t.unsigned_float` and `t.unsigned_decimal` shorthands work on 7.2 with no warning. Rails 8.0 still creates the same column but warns each time a migration calls them:

```
DEPRECATION WARNING: unsigned_float is deprecated and will be removed from Rails 8.1
```

`unsigned_integer` and `unsigned_bigint` are not deprecated. `db/schema.rb` already writes the `unsigned: true` option form, so only migrations that still run (a fresh `db:migrate`) warn.

**Detection Pattern:**
```ruby
# db/migrate/*.rb
t.unsigned_float :amount
t.unsigned_decimal :price, precision: 10, scale: 2
```

**Fix:**
```ruby
# BEFORE
t.unsigned_float :amount

# AFTER
t.float :amount, unsigned: true
```
The AFTER works on 7.2 too: the shorthand only sets `unsigned: true` on both versions.

---

#### `Benchmark.ms` Deprecated

**Pattern:** `BENCHMARK_MS`

**What Changed:**
`Benchmark.ms` is an Active Support core extension, not part of Ruby's `benchmark` library. Rails 7.2 runs it with no warning. Rails 8.0 still returns the elapsed milliseconds but warns on every call:

```
DEPRECATION WARNING: `Benchmark.ms` is deprecated and will be removed in Rails 8.1 without replacement.
```

**Detection Pattern:**
```ruby
elapsed = Benchmark.ms { run_report }
```

**Fix:**
```ruby
# BEFORE
elapsed = Benchmark.ms { run_report }

# AFTER
require "benchmark"
elapsed = Benchmark.realtime { run_report } * 1000
```
The AFTER works on 7.2 too: `Benchmark.realtime` is Ruby's own method and returns seconds as a Float. Keep the `require`: Active Support 8.0 loads the library, but 8.1 no longer does, so without it the call raises `NameError: uninitialized constant Benchmark` after the next hop. On Ruby 3.4 and newer, add `gem "benchmark"` to the Gemfile as well: Ruby 3.4 warns that it leaves the default gems in Ruby 4.0.

---

#### `bin/rake stats` Deprecated

**Pattern:** `RAKE_STATS`

**What Changed:**
Rails 8.0 adds a `bin/rails stats` command and keeps the `stats` rake task only as a deprecated wrapper. `bin/rake stats` still prints the report, with a warning first:

```
DEPRECATION WARNING: `bin/rake stats` has been deprecated and will be removed in Rails 8.1.
```

The same release deprecates adding directories through `STATS_DIRECTORIES` in favor of `Rails::CodeStatistics.register_directory`, which does not exist on 7.2.

**Detection Pattern:**
```yaml
# .github/workflows/*.yml, bin/*
- run: bin/rake stats
```

**Fix:**
```yaml
# BEFORE
- run: bin/rake stats

# AFTER
- run: bin/rails stats
```
The AFTER works on 7.2 too: `bin/rails` hands a name it does not know to Rake, so it runs the same task.

---

## Solid Gems Decision Guide

| Current Setup | Recommendation |
|--------------|----------------|
| Redis for cache/jobs/cable | Keep Redis - simpler to maintain |
| Sidekiq with complex workflows | Keep Sidekiq |
| Simple background jobs | Consider Solid Queue |
| Need real-time WebSockets | Keep Redis for Cable |
| Want simpler infrastructure | Use Solid gems |
| Heroku/PaaS deployment | Solid gems or Redis add-on |
| Self-hosted/Docker | Either works well |

---

## Migration Steps

### Phase 1: Preparation
```bash
git checkout -b rails-80-upgrade

# Verify Ruby version
ruby -v  # Should be 3.1+
```

### Phase 2: Gemfile Updates
```ruby
# Gemfile
gem 'rails', '~> 8.0.0'

# Choose asset pipeline:
gem 'propshaft'  # New default
# OR
gem 'sprockets-rails'  # Keep existing

# Optional Solid gems (only if migrating):
# gem 'solid_cache'
# gem 'solid_queue'
# gem 'solid_cable'
```

```bash
bundle update rails
```

### Phase 3: Asset Pipeline Decision

**If keeping Sprockets:**
```ruby
# Gemfile
gem 'sprockets-rails'
```
No other changes needed!

**If migrating to Propshaft:**
1. Remove Sprockets-specific configs
2. Update asset structure if needed
3. Use cssbundling-rails for Sass

### Phase 4: Configuration
```bash
rails app:update
```

Update `config/application.rb`:
```ruby
config.load_defaults 8.0
```

Add to production.rb:
```ruby
config.assume_ssl = true
```

### Phase 5: Testing
- Verify assets load correctly
- Test caching if using Solid Cache
- Test background jobs
- Test WebSockets if applicable

---

## Propshaft Migration Checklist

- [ ] Remove `sprockets-rails` from Gemfile
- [ ] Add `propshaft` to Gemfile
- [ ] Remove `config.assets.*` from environment files
- [ ] Verify assets serve correctly
- [ ] If using Sass, add `cssbundling-rails`
- [ ] Update asset precompilation in deployment

---

## Common Issues — Quick Reference

Error → section lookup for the most common errors encountered during this upgrade:

| Error | See |
|-------|-----|
| 404 for CSS / JS files | "Sprockets → Propshaft" — Propshaft needs no config, files go in `app/assets/`; Sprockets needs `gem 'sprockets-rails'` |
| `ERR_TOO_MANY_REDIRECTS` | "assume_ssl Configuration" — `config.assume_ssl = true` behind a proxy |
| Solid Queue jobs stuck in pending | "Solid Queue (Optional)" — start the supervisor, `bin/jobs` |
| `` DEPRECATION WARNING: `to_time` will always preserve the full timezone `` (or `receiver timezone`) at boot | "to_time Preserves the Full Timezone": set `to_time_preserves_timezone = :zone`; `load_defaults 8.0` later |
| `DEPRECATION WARNING: 'config.read_encrypted_secrets=' is deprecated` on the 7.2 side | "read_encrypted_secrets Removed": delete the line |
| `ArgumentError: wrong number of arguments (given 0, expected 1..2)` from an `enum` line | "`enum` Keyword-Arguments Form Removed": `enum :status, { ... }, prefix: true` |
| `` DEPRECATION WARNING: Setting `ENV["SCHEMA_CACHE"]` is deprecated `` on the 7.2 side | "`SCHEMA_CACHE` Environment Variable No Longer Read": set `schema_cache_path:` in `database.yml` |
| `DEPRECATION WARNING: Mapping a route with multiple paths is deprecated` at boot | "Routes Drawn With Multiple Paths Deprecated": one route call per path |
| `NoMethodError: undefined method 'warn_on_records_fetched_greater_than='` (or `allow_deprecated_singular_associations_name=`, `commit_transaction_on_non_local_return=`) for class ActiveRecord::Base | "Removed Active Record Config Keys Raise NoMethodError": delete the line |
| `` DEPRECATION WARNING: `Benchmark.ms` is deprecated `` | "`Benchmark.ms` Deprecated": `Benchmark.realtime { ... } * 1000` |
| `` DEPRECATION WARNING: `bin/rake stats` has been deprecated `` | "`bin/rake stats` Deprecated": run `bin/rails stats` |

---

## Gem Compatibility

| Gem | Minimum Version | Notes |
|-----|-----------------|-------|
| devise | 4.9.0 | Works well |
| sidekiq | 7.0.0 | Keep if using |
| rspec-rails | 6.0.0 | Update recommended |
| capybara | 3.39.0 | Works well |
| webmock | 3.19.0 | Works well |

---

## Files Changed by app:update

| File | Change |
|------|--------|
| Gemfile | Rails version, Propshaft |
| config/application.rb | load_defaults 8.0 |
| config/environments/production.rb | assume_ssl, cache config |
| config/database.yml | Multi-database structure |
| Dockerfile | New file |
| config/deploy.yml | New file (Kamal) |
| bin/jobs | New file (Solid Queue) |

---

## Resources

- [Rails 8.0 Release Notes](https://guides.rubyonrails.org/8_0_release_notes.html)
- [Propshaft Documentation](https://github.com/rails/propshaft)
- [Solid Cache](https://github.com/rails/solid_cache)
- [Solid Queue](https://github.com/rails/solid_queue)
- [Kamal Documentation](https://kamal-deploy.org)
planning-and-task-breakdownaddyosmani/agent-skillsBreaks work into ordered tasks. Use when you have a spec or clear requirements and need to break work into implementable tasks. Use when a task feels too large to start, when you need to estimate scope, or when parallel work is possible.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
screenpipethedotmack/claude-memSearch screen and audio history recorded by Screenpipe and optionally save selected context into claude-mem. Use when the user asks to recall desktop activity, a meeting, or something seen in another app through Screenpipe.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
contact-widgetnexu-io/open-designSelf-contained floating chat widget with welcome screen, social links, meeting button, and message input. Single HTML file, zero dependencies.Stars: 108kUpdated Claude CodeCodexVerifiedInstall
meeting-notesnexu-io/open-designMeeting notes page — title bar with attendees, agenda checklist, decisions block, action items table with owners + dates, and a "next meeting" footer. Use when the brief mentions "meeting notes", "minutes", "1:1 notes", "all-hands recap", or "侚čŪŪįšŠč́".Stars: 108kUpdated Claude CodeCodexVerifiedInstall