Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I upgraded my app from 6.0.3.4 to 6.1.0 and got this error message. Looked it up and didn't find anything.

I have a very basic usage of ActiveStorage

error message

like image 696
Dorian Avatar asked Dec 29 '20 22:12

Dorian


2 Answers

You need to create the new upgrade migrations via:

rails active_storage:update
like image 158
Dorian Avatar answered Oct 28 '22 01:10

Dorian


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.

like image 42
MartinWood Avatar answered Oct 28 '22 01:10

MartinWood