34

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

Dorian
  • 7,749
  • 4
  • 38
  • 57

3 Answers3

75

You need to create the new upgrade migrations via:

rails active_storage:update
Dorian
  • 7,749
  • 4
  • 38
  • 57
  • 5
    Man, would be nice if this was in the upgrade notes here https://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-6-0-to-rails-6-1 anyone know how to make that change happen? – genkilabs Feb 02 '21 at 17:57
  • 1
    you can raise it as an issue on github.com/rails/rails or make a pull request – Dorian Feb 02 '21 at 22:09
  • 8
    make sure to obviously run `rake db:migrate` after this. – Corey Jun 17 '21 at 20:10
  • 2
    This works, but my tests was still failing. If you use active storage fixtures as part of your test, you need to add `service_name: test` to it. For example, in `fixtures/active_storage/blobs.yml`, add `service_name: test` for each record. – oky_sabeni Apr 17 '22 at 12:56
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.

MartinWood
  • 31
  • 2
0

I know this is a little ridiculous, but I had the same error message on heroku (I had already updated ActiveStorage locally and everything was ready to go live).

All that was required was:

heroku restart

and everything worked as expected.

stevec
  • 41,291
  • 27
  • 223
  • 311