-
Rails 7.0.0 is not compatible with Ruby 3.1.0.
-
"Rails::Engine is abstract, you cannot instantiate it directly.."
$ bin/rails s Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead. [WARNING] Could not load command "rails/commands/server/server_command". Error: Rails::Engine is abstract, you cannot instantiate it directly.. /path/to/rails/railties/lib/rails/railtie.rb:246:in `initialize' /path/to/rails/railties/lib/rails/railtie.rb:184:in `new' /path/to/rails/railties/lib/rails/railtie.rb:184:in `instance' /path/to/rails/railties/lib/rails/railtie.rb:223:in `method_missing' /path/to/rails/activesupport/lib/active_support/descendants_tracker.rb:90:in `descendants'
-
Use
7-0-stable
branch until Rails 7.0.1 is released.gem "rails", github: "rails/rails", branch: "7-0-stable"
- Use Rails 6.1.4 to support
database.yml
with aliases. - If you use
secrets.yml
with aliases, use6-1-stable
branch.gem "rails", github: "rails/rails", branch: "6-1-stable"
- You will likely get this error.
Psych::BadAlias: Unknown alias: default
- Upgrade to Rails 6.1.4 or higher.
- No Psych 4 support has been backported to Rails 6.0. Use Psych 3 as a workaround.
gem "psych", "~> 3.0"
https://guides.rubyonrails.org/maintenance_policy.html As of Dec 25, 2021, Supporting Ruby 3.1 with Rails should not be security issues.
- Rails 7.0.Z accepts bug fixes.
- Rails 6.1.Z accepts security issues only.
- Rails 6.0.Z accepts severe security issues only.
- Add
Class#descendants
- Psych 4 support
net-smtp
,net-imap
,net-pop
are bundled gems- Ruby 3.1 performance optimization
- DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated.
-
Rails 7.0.0 expects Ruby 3.1 has both of
Class#descendants
andClass#subclasses
or not. -
Ruby 3.1 supports
Class#subclasses
only,Class#descendants
has been removed on Dec 21, 2025. -
Rails 7.0.0 did not expect one of these methos removed.
-
Rails 7.0.1 supports Ruby 3.1
Class#subclasses
. -
Related pull requests at Ruby
-
Related pull requests at Rails
-
Ruby 3.1.0 installs Psych 4.0.3 as standard library
-
https://www.ruby-lang.org/en/news/2021/12/25/ruby-3-1-0-released/
Psych 4.0 changes Psych.load as safe_load by the default. You may need to use Psych 3.3.2 for migrating to this behavior. [Bug #17866]
-
Psych 4 support at Rails
-
Included to Rails 6.1.4 or later
-
Rails 7.0.0 or later, not released as Rails 6.1.Z yet because it has been to
6-1-stable
after Rails 6.1.4 was released.
-
config/database.yml
default: &default adapter: sqlite3 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> timeout: 5000 development: <<: *default database: db/development.sqlite3 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: <<: *default database: db/test.sqlite3 production: <<: *default database: db/production.sqlite3
config/secrets.yml
(Rails 4.1+) orconfig/secrets.yml.enc
(Rails 5.1+)- You will get this error run Rails 6.1 with Ruby 3.1.0
$ bin/rails s => Booting Puma => Rails 6.1.4.4 application starting in development => Run `bin/rails server --help` for more startup options Exiting /home/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:430:in `visit_Psych_Nodes_Alias': Unknown alias: default (Psych::BadAlias)
config/credentials.yml.enc
- No alias supported in Rails main branch because it should not need alias support.
- If you need to use
mail
gem, add them explicitly in your Gemfile - mikel/mail#1439
- Optimize dynamic string interpolation for symbol/true/false/nil/0-9 ruby/ruby#5002 rails/rails#43772 https://bugs.ruby-lang.org/issues/13715
- Calling
DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call
DidYouMean.correct_error(error_name, spell_checker)' instead. - rails/thor#761