Search code examples
ruby-on-railsrubyimagemagick-convertminimagick

"Errno::ENOENT in ListingsController#create" in Rails application


After adding include CarrierWave::MiniMagick to my image_uploader.rb file as well as uncommenting the process: resize to fit => [200,300] line inside of image_uploader.rb, whenever I attempt to create a new Listing in my app I receive the following error message:

"Errno::ENOENT in ListingsController#create" with the explanation of "No such file or directory - identify".

It appears the error is occurring in the directory of 'app/controllers/listings_controller.rb' on line 20 inside the "Create" action.

Description of extracted source on the error page shows this: self.pid = Process.spawn({'LANG' => self.lang}, command, log_opts) as the line raising an error.

Prior to these two mentioned changes, the new Listing would be created with no issue whatsoever (apart from the attached image being much too large, hence my newest change). I'm using Cloud9 IDE to develop this application, with Puma as my web server, and Heroku as the (intended) future production-grade app host.


Solution

  • No such file or directory - identify

    This is mean that ImageMagick package isn't installed in your OS. So, try to find way to install ImageMagick package to your Heroku node.

    Update

    This answer says that ImageMagic is installed to Heroku already. So, try to add Ruby wrapper of ImageMagick to your Gemfile:

    gem 'mini_magick', '~> 4.1.0'