我的專案中有影像ActiveStorage.attach
if params[:avatar]
authorize! :update, current_user
type, base64_image = Utils::Attach.type_and_base64(params[:avatar], 'avatar')
current_user.avatar.attach(io: StringIO.new(base64_image), filename: "#{current_user.id}-#{Time.current.to_i}", content_type: type)
current_user.save!
end
它實際上作業得很好。但是在我為郵件添加 sidekiq 后,我開始看到錯誤
附加頭像后添加此錯誤。

uj5u.com熱心網友回復:
我沒有找到解決分析作業的正確方法,但猴子修補對我的情況很有用。
module ActiveStorage::Blob::Analyzable
def analyze_later
analyze
end
end
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/510060.html
標籤:轨道上的红宝石红宝石侧基rails-activestorage
