SoSoraEndo2026年4月21日2 min173 字
概要
AetherEchoes のバージョンアップで Rails 6.1.7 を Rails 8.1.3 に引き上げました。API-only 構成でも load_defaults や Spring 周りで手当てが必要だったので手順を共有します。
主な変更点
1. load_defaults を 8.1 へ
# config/application.rb
config.load_defaults 8.1
2. cache_classes は enable_reloading に
# development.rb
config.enable_reloading = true
3. Spring の廃止
Rails 7 以降、標準添付されなくなりました。bin/rails から load File.expand_path("spring", __dir__) を削除し、bin/spring と config/spring.rb を消します。
4. show_exceptions がシンボルへ
# test.rb
config.action_dispatch.show_exceptions = :none
5. :unprocessable_entity を :unprocessable_content に
Rack のステータスシンボル名が変更されました。render status: と RSpec の have_http_status の両方を置換します。
まとめ
API-only プロジェクトでも config の小さな書き換えは複数発生します。段階的に適用して RSpec を都度走らせるのが確実です。