代码之家  ›  专栏  ›  技术社区  ›  TrongBang

具有活动存储器的Rails 5导致minimagick::无效错误,消息为图像头不正确

  •  1
  • TrongBang  · 技术社区  · 7 年前

    在使用活动存储升级到rails 5之后,每次上传都会出现这个错误。

    Failure/Error: self.image.variant(resize: large_size).processed
     MiniMagick::Invalid:
       `identify /var/folders/9f/llmvc73n031_s_hn2fqg1czh0000gn/T/mini_magick20180706-88409-k0z76z.png` failed with error:
       identify: improper image header `/var/folders/9f/llmvc73n031_s_hn2fqg1czh0000gn/T/mini_magick20180706-88409-k0z76z.png' @ error/png.c/ReadPNGImage/4229
    

    这是我的gemfile。

    gem 'rails', '~> 5.2.0'
    
    gem 'execjs' 
    gem 'therubyracer'
    
    #gem 'mini_magick'
    gem 'image_processing', '~> 1.2'
    

    有人经历过吗?

    1 回复  |  直到 7 年前
        1
  •  0
  •   TrongBang    7 年前

    实际上问题出在别的地方。我想解决这个问题 Rails 5 ActiveStorage How to wait for all threads to finish . 我还以为这和activestorage有关。但实际上,另一页的答案与我编写代码的方式有关。

    推荐文章