MiniMagick - unable to load such a file

I am trying to use MiniMagick to resize images, and in my controller file I did the following:

require 'rubygems' require 'mini_magick' 

and

 img = MiniMagick::Image.open(file) 

But when I call the controller,

 LoadError (cannot load such file -- mini_magick) 

I added the gem 'mini_magick' to my Gemfile, so I have no idea what is going on. Can someone help me with this?

BTW, it is available both in irb and rails console , but not when launched as a server.

thanks in advance.

+8
source share
5 answers

Hell, restart the server, resolving it.

+17
source

I also ran into this problem. Just uncomment the line

 include CarrierWave::MiniMagick 

in your bootloader file and make sure you comment out the line

 include CarrierWave::RMagick 

So, your setup in the uploader file should look like this:

 # include CarrierWave::RMagick include CarrierWave::MiniMagick 
0
source

Sometimes this problem occurs due to the lack of the latest version of gems. It can be fixed by updating the package.

0
source

Add the gem "mini_magick" to your gemfile

and reboot your server.

0
source

Whenever you get this error, just add the gem "mini_magick" and restart the server using the rails s command. But most importantly, do not forget to always check your server logs on your terminal for an error message. They are your best friend in finding the solution you need for your problem.

0
source

All Articles