我正在尝试为 Ruby on Rails API 项目实现 Active Storage。我已经根据文档放置了 has_one_attached :picture 。并成功在AWS S3服务上上传图片。现在,当我尝试访问志愿者数据时,它说
Run Code Online (Sandbox Code Playgroud)ActiveStorage::Attachment Load (0.6ms) 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", 8695], ["record_type"], "Volunteer" ["name", "picture"], ["LIMIT", 1]] ActiveStorage::Blob Load (0.4ms) SELECT "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2 [ ["id", 5], ["LIMIT", 1]] [active_model_serializers] 渲染 ActiveModel::Serializer::Null with ActiveStorage::Attached::One (58.41ms) 在 322ms 内完成 500 个内部服务器错误 (ActiveRecord: 48.8)多发性硬化症)
Run Code Online (Sandbox Code Playgroud)SystemStackError (stack level too deep):
我已经通过 Rails 控制台检查了数据,图像保存在图片属性中。志愿者的架构如下 …