rmagick under windows
I installed ImageMagick and RMagick on Windows Vista in a Rails environment this way:
First I downloaded ImageMagick-6.6.7-Q16 from http://www.imagemagick.org/download/binaries/ and installed it in "C:\ImageMagick-6.6.7-Q16" folder.
Then I downloaded RMagick from https://github.com/rmagick/rmagick/zipball/master and extracted it into "C:\RailsInstaller\Ruby1.9.2\lib\ruby\gems\1.9.1\bundler\gems\rmagick-rmagick\" folder (which is my ruby bundler gems folder).
Then I simply called
'gem install rmagick'
from my prompt and it all worked fine.
Now I can call from a Rails app Gemfile
gem "rmagick"
And then 'bundle install' works fine.
PS: please note that I first installed Rails with http://www.railsinstaller.org.
How to install rmagick gem on Windows?
RMagic won't work with ImageMagic 6.8. I updated the RMagick Github wiki with detailed instructions.
https://github.com/rmagick/rmagick/wiki
There I found gems (haha) such as
If ImageMagick isn't first in your system path, you'll get an "Invalid
drive specification" error when extconf.rb tries to identify the
ImageMagick version.
and
gem install rmagick -- '--with-opt-dir="[path to ImageMagick]"'
(Obvious, huh?)
I believe RMagick is a dead project. There hasn't been a commit for 2 years!
Ruby on Rails RMagick on Windows 7
First and most important, when reporting issues or asking for help, always include version information about what you're trying to install, specially Ruby.
It seems you're installing using RailsInstaller, but since you didn't mention if is the 2.0 preview version or the stable one, I'll assume you used the stable one, which is based on Ruby 1.8.7-p334.
Now, RailsInstaller already includes the needed pieces: Ruby and RubyInstaller DevKit component, so going to skip the steps about installation of that and jump directly to RMagick itself.
To successfully install RMagick gem, you need ImageMagick binaries with development headers, as documented in RubyInstaller's Tutorial wiki page, which links here
Please download 32bits version of ImageMagick, as Ruby is 32bits.
For my test I've downloaded the installer version ImageMagick-6.7.0-8-Q16-windows-dll.exe
Once downloaded and installed in a path without spaces and I've selected the option Install development headers and libraries for C and C++.
Then open a new Command Prompt, ensure Ruby is available (checking with ruby -v
) and after performed the following command:
gem install rmagick --platform=ruby -- --with-opt-lib=C:\ImageMagick-6.7.0-Q16\lib --with-opt-include=C:\ImageMagick-6.7.0-Q16\include
That command is going to take considerable amount of time (took 1 minute on my Core 2 Duo) but the end result was:
Fetching: rmagick-2.13.1.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Successfully installed rmagick-2.13.1
1 gem installed
Now you can verify RMagick installed successfully using IRB:
irb(main):001:0> require "rubygems"
=> true
irb(main):002:0> require "rmagick"
=> true
irb(main):003:0> Magick::Version
=> "RMagick 2.13.1"
Now, if you're using Ruby 1.9.2, last RMagick release is not compatible with it and you will need to build from source. There is another tutorial on RubyInstaller wiki that covers that, but please read this thread at RubyInstaller group were we discuss the issues.
Hope all this helps.
Problems installing RMagick
I would ditch RMagick altogether.
RMagick eats up a ton of memory. There are other ruby wrappers for ImageMagick out there that I have had an easier time using.
https://github.com/probablycorey/mini_magick
MiniMagick is pretty straightforward.
Best of luck.
RMagick build on Windows fails
I had to use the 32bit installation instead of the 64bit. Thanks to the good folks of Rubyinstaller at Google Groups to point me in the right direction.
Related Topics
How to Use Activerecord in a Ruby Script Outside Rails
Find Key/Value Pairs Deep Inside a Hash Containing an Arbitrary Number of Nested Hashes and Arrays
How to Use Define_Method to Create Class Methods
Match a String Against Multiple Patterns
Json Encoding Wrongly Escaped (Rails 3, Ruby 1.9.2)
Installed Ruby Using Apt-Get Install Ruby 2.0.0 Succeeded But Not Using Correct Ruby Version
How to Get Class Instances in Ruby
Uninstall All Installed Gems, in Osx
Merge and Interleave Two Arrays in Ruby
Using Rails Migration on Different Database Than Standard "Production" or "Development"
Exporting an Environment Variable in Ruby
Why Does Adding "Sleep 1" in an After Hook Cause This Rspec/Capybara Test to Pass
Nomethoderror When Trying to Invoke Helper Method from Rails Controller
"Certificate Verify Failed" Openssl Error When Using Ruby 1.9.3