I am upgrading my app to Rails 3.2 on Ruby 1.9. I had to drop attachment_fu
. Carrierwave seemed the obvious replacement. At this stage I am uploading files to the file system (no cloud files, yet).
I am on Lion, XCode 4.3.2, Command Line Tools installed. Running:
$ brew doctor
# Your system is raring to brew.
I can upload and resize images in this configuration:
- rails 3.1.4
- ruby 1.8.7
- carrierwave 0.5.8
- mini_magick 3.4
I can upload images in the new configuration:
- rails 3.2.3
- ruby 1.9.3 (or 1.9.2)
- carrierwave 0.6.2
(followed by $ bundle update
) but resizing using mini_magick
returns this error message:
"File Failed to manipulate with MiniMagick, maybe it is not an image Original Error: MiniMagick::Invalid", where File is the carrierwave uploader.
The FileUploader contains:
include CarrierWave::MiniMagick
def store_dir .. end # the shipped default
process :resize_to_limit => [500, 600]
My Attachment class (with the mount_uploader :file, FileUploader
) is a parent of Portrait
, ReferenceLetter
, and other attachment kind of classes. Each of the attachment classes inherits from the Attachment
, is :polymorphic => true
, and belongs_to :attachable
(User) which, in turn, has_many :portraits
, :reference_letters
, etc. :as => :attachable
.
None of these worked (linked from carrierwave's known issues page):
Why is this RMagick call generating a segmentation fault?
I didn't want to install ImageMagick manually as suggested here:
carrierwave + mini_magick gems = not an image error
I'm using Homebrew. Help would be fantastic. Thanks.
First make sure your machine has all the compilers and tools it needs.
Feb 2014
I just ran into this issue and was all excited to spend my day compiling ImageMagick from source, but figured I'd try a
brew update && brew upgrade imagemagick
first.It worked.
Was fighting with the same error today. The problem was not in mini_magick, the problem is in DELEGATES options in your imagemagick
If you run
you should have something like this
But in my case key DELEGATES had only xml and zlib values
The solution was to install imagemagick from source and add params to ./configure
You can find installations instructions for MacOS here http://www.imagemagick.org/script/advanced-unix-installation.php
UPDATE
For some reasons, a system can be without jpeg convert libraries. To fix this you can install imagemagick using apt-get or ppa with all needed dependencies or try to install manualy
See more info here https://askubuntu.com/questions/211627/how-to-add-support-for-the-jpeg-image-format
UPDATE 01/26/2013
To install libpng
Follow this link http://www.libpng.org/pub/png/libpng.html and find "Source Code" block. Copy a link for a latest version
Another way to get JPEG support