active_storage_validations: Rails 6.0.0.rc1: ActiveStorage::FileNotFoundError on model save

The following declaration throws ActiveStorage::FileNotFoundError in Rails 6.0.0.rc1 when I try to save a model:

validates :image, attached: true, content_type: IMAGE_CONTENT_TYPE,
  dimension: { width: IMAGE_WIDTH, height: IMAGE_HEIGHT }

with the following cause:

Errno::ENOENT: No such file or directory @ rb_sysopen - /home/oleksandri/Code/marketplace/storage/08/3z/083z1pphjimzuwty55kqvb7t1hhj

Is it supported in Rails 6?

Thank you for your valuable work

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 17 (15 by maintainers)

Most upvoted comments

@danderozier I’m speaking about this commit https://github.com/danderozier/active_storage_validations/commit/a5d81ca4369fb078858ed4f53d2fdc7d0294a2c6

please pull the latest changes from my branch and see new file : AspectRatioValidator this for dimention validations, it has similar code, so I think this change is needed there too?

Here the line of method analyze: active_storage/blob/analyzable.rb#L28

The code is the same on both versions, how the image is loaded:

So, it is more an active storage issue. Can you please open an issue directly on Rails repo?