Ditch the rake task and try this method instead
rails app:update
rake task, which is the
approach recommended in the official Rails Guides,
I prefer to generate a new app, for example with the following command:rails new --database postgresql --skip-test /tmp/my-app
# Use any other flag to make it as close as possible to the original app
.git
directory. After that, I compare the changes in each file
and decide whether to keep or remove them based on whether they make sense for
my project running on the new version of Rails.config/initializers/new_framework_defaults_[old-version].rb
file, which is
frequently overlooked and left unmodified (until it causes problems or during
the next upgrade), resulting in the app running on the new Rails version with
some of the old version's defaults.app/models/application_record.rb
file at all,
while this method would have replaced: class ApplicationRecord < ActiveRecord::Base
- self.abstract_class = true
+ primary_abstract_class
end
rails new
command from the latest Rails.