ruby-on-railsimagemagickruby-on-rails-6minimagickactiontext

Action Text displaying image error rails 6 on windows 10


I am using windows 10 to program ruby on rails 6 with the help of ruby installer. Everything works fine so far until... I use action text for rich text editor.

I followed this guide [https://edgeguides.rubyonrails.org/action_text_overview.html][1] and everything works. But when I attach an image to the text_area, after saving the image cannot be displayed.

When I open the image's url, I see this:

MiniMagick::Error in ActiveStorage::RepresentationsController#show

`magick mogrify -resize-to-limit [1024, 768] C:/Users/.../AppData/Local/Temp/ActiveStorage-5-20200716-3792-28u8ot.jpg` failed with error: mogrify: unrecognized option `-resize-to-limit' @ error/mogrify.c/MogrifyImageCommand/6009.


  if status != 0 && options.fetch(:whiny, MiniMagick.whiny)
    fail MiniMagick::Error, "`#{command.join(" ")}` failed with error:\n#{stderr}"
  end

Model: Product

Display in view: product.description ( attached image cannot be displayed )

Can anyone help me solve this problem?


Solution

  • Add gem 'image-processing' to your Gemfile and

    run bundle install