Hi Frantz
I have an issue similar to Mattia's, so I tried your suggestion.
Thanks for the advice, although installing mini_magick (v4.8) didn't solve the issue for me.
For context, I'm on ruby 2.4.2 / rails 5.2 / active storage 5.2
I followed this tutorial for the active storage setup
I tried to upload via a form and to directly attach a local file to an existing object in the rails console.
Strangely enough I have a first `NoMethodError: undefined method `[]' for nil:NilClass` when trying the first time,
and the `Unable to autoload constant ActiveStorage::Blob::Analyzable` error the second time.
The full session log if it helps:
==========================
2.4.2 :001 > store = Store.first Store Load (0.3ms) SELECT "stores".* FROM "stores" ORDER BY "stores"."id" ASC LIMIT $1 [["LIMIT", 1]] => #<Store id: "b02fb2d3-0d0a-4edd-9620-a770be10479b", subdomain: "test2", name: "new store", created_at: "2018-06-12 09:25:28", updated_at: "2018-06-1209:25:28">
2.4.2 :002 >
2.4.2 :003 >
2.4.2 :004 >
2.4.2 :005 >
2.4.2 :006 > store.header_image.attach(io: File.open('/Users/skthg/Downloads/stock-photo-macro-close-up-portrait-of-woman-having-facial-beauty-treatment-in-spa-therapist-massaging-chin-693071524.jpg'), filename:'chin.jpg', content_type: 'image/jpeg', identify: false)
ActiveStorage::Attachment Load (0.4ms) SELECT "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = $1 AND "active_storage_attachments"."record_type" = $2 AND "active_storage_attachments"."name" = $3 LIMIT $4 [["record_id", 0], ["record_type", "Store"], ["name", "header_image"], ["LIMIT", 1]]
NoMethodError: undefined method `[]' for nil:NilClass
from (erb):12:in `<main>'
from (irb):6
2.4.2 :007 > store.header_image.attach(io: File.open('/Users/skthg/Downloads/stock-photo-macro-close-up-portrait-of-woman-having-facial-beauty-treatment-in-spa-therapist-massaging-chin-693071524.jpg'), filename:'chin.jpg', content_type: 'image/jpeg', identify: false)
LoadError: Unable to autoload constant ActiveStorage::Blob::Analyzable, expected /Users/skthg/.rvm/gems/ruby-2.4.2/gems/activestorage-5.2.0/app/models/active_storage/blob/analyzable.rb to define it
from (irb):7
2.4.2 :008 >
Regards
2018年6月11日月曜日 18時46分15秒 UTC+2 Frantz Augustin: