0

I am using carrierwave to upload images to my project, following along with Ryan Bates railscasts here.

I am using ruby 1.9.2p290 (2011-07-09) [i386-mingw32], and rails 3.1.0

In the episode it says in order to have use rmagick you have to install it in your gemfile like so

gemfile

gem 'rmagick'

and then run bundle install I get the error

Installing rmagick (2.13.1) with native extensions C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:533:in `rescue in block in build_extensions': ERROR
: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

    C:/Ruby192/bin/ruby.exe extconf.rb
checking for Ruby version >= 1.8.5... yes
Invalid drive specification.
Unable to get ImageMagick version
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=C:/Ruby192/bin/ruby

So I googled the Unable to get ImageMagick version and found this link here and followed the directions, downloaded the RMagick-2.13.1.tar.gz, extracted to c:\rmagick, and ran the

ruby setup.rb command

and got the following error.

c:\RMagick-2.13.1>ruby setup.rb
---> lib
---> lib/rvg
<--- lib/rvg
<--- lib
---> ext
---> ext/RMagick
C:/Ruby192/bin/ruby.exe c:/RMagick-2.13.1/ext/RMagick/extconf.rb
checking for Ruby version >= 1.8.5... yes
Invalid drive specification.
Unable to get ImageMagick version
*** c:/RMagick-2.13.1/ext/RMagick/extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Once again, the error Unable to get ImageMagick version. I thought Imagemagick came bundled with the windows installation. Anyone have any help on this matter?

ruevaughn
  • 1,319
  • 1
  • 17
  • 48

1 Answers1

3

CarrierWave is indeed a great solution for managing image uploads in Rails. RMagick is very powerful, but you won't believe how much trouble me and my friends had through the years while installing and upgrading RMagick and ImageMagick in various environments and operating systems (especially Windows and Mac).

If you have ImageMagick installed, and you don't worry too much about performance, you can use MiniMagick instead of RMagick. It's much easier to install it. In your uploader class you can include MiniMagick:

class MyUploader < CarrierWave::Uploader::Base  
  include CarrierWave::MiniMagick

  ...
end

This complexity of image processing tools is one of the reason I would suggest you take a look at our solution for integrating CarrierWave while all image transformations are done in the cloud (no need to install RMagick or ImageMagick at all). This blog post describes the solution. Just switch the CarrierWave plugin you include:

class MyUploader < CarrierWave::Uploader::Base  
  include Cloudinary::CarrierWave

  ...
end
Cloudinary
  • 541
  • 3
  • 4
  • Awesome. I was looking at minimagick but decided to try and tough it out. I will take your advice and ditch RMagick on this one. – ruevaughn Apr 27 '12 at 03:09