undefined method 'service_name' for ActiveStorage::Blob after upgrading to rails 6.1.0

Solution 1:

You need to create the new upgrade migrations via:

rails active_storage:update

Solution 2:

Similar error message going from 6.0.2 -> 6.1.1 for me :

Can't resolve image into URL: undefined method `service_name'

again, the "rails active_storage:update" command fixes this by adding the required attributes to the database tables, but logging here as a search for the above error was returning nothing useful from Google at the time.