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
andIf 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.
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!
installing rmagick gem on windows
I had this problem a few days ago and I solved it by following a bunch of tutorials.
In short, your error seems to be due to a compatibility problem between your ImageMagic and Rmagick.
Uninstall ImageMagick and re-install a previous version that works with your Ruby setup.
This is what worked for me :
- Ruby 1.9.3
- Dev Kit 32-4.5.2
- ImageMagick 6.7.7 (I had a really hard time finding binary versions for legacy versions of ImageMagick so i guess this link will be handy for you)
- Rmagick 2.13.2
Install ImageMagick and rmagick on Windows 7
I have installed it. You will need to install Ruby Devkit.
https://rubyinstaller.org/downloads/
It was very tedious process so I made notes for a client. Steps are mislabelled because it includes installing git and ruby first. I would use more recent instructions on websites if available.
I think that ImageMagick needed to be version 6, not sure.
Here are the notes:
3. Install devkit
Same link http://rubyinstaller.org/Download and extract to C:\RubyDevkit
Follow steps 3.1 and 3.2 if you downloaded DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe
For other versions, if you are getting error messages then use instructions from http://rubyinstaller.org/
which used to link to this document:
https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
- Download matching version (from http://rubyinstaller.org/)
- Uninstall previous version if it exists.
- Extract to C:\RubyDevKit
cd C:\RubyDevKit
ruby dk.rb init
ruby dk.rb install
devkitvars.bat
4. Install imagemagick
If your ruby is 32 bit, install 32 bit otherwise 64 bit.What works for sure is
ImageMagick-6.7.3-4-Q16-windows-dll.exe
Don't install in Program Files
because 3rd party scripts might have problems with spaces.
Install in C:\ImageMagick
so that you can copy paste commands later
Make sure these options are checked
- Add application directory to your system path
- Install development headers and libraries for C and C++
5. Install rmagick gem
Just running bundle install fails because it requires more options.
Run this from anywhere in cmd.exe
To open cmd.exe
open Start Menu and under Search programs and files
type cmd.exe
set CPATH="C:\ImageMagick\include"
set LIBRARY_PATH="C:\ImageMagick\lib"
Unfortunately these commands give no visual feedback like OK. To get feedback you can type this:echo %CPATH%
And you should get output "C:\ImageMagick\include"
echo %LIBRARY_PATH%
And you should get output "C:\ImageMagick\lib"
gem install rmagick -- '--with-opt-dir="C:\ImageMagick"'
You should get a success message. You can verify if gem is installed by typing gem list
It should list rmagick.Try this first, but in case this doesn't work, look up more current instructions on:
https://github.com/rmagick/rmagick/wiki/Installing-on-Windows
Related Topics
Can Optionparser Skip Unknown Options, to Be Processed Later in a Ruby Program
How to Remove Backslashes from a JSON String
Nomethoderror: Undefined Method 'On' for Main:Object
What's an Example of Ruby Code That's "Too Clever"
What Is Returned in Ruby If The Last Statement Evaluated Is an If Statement
Rails 3, Http Extensions (Webdav) and Rack App Mounting
Rails: What's Wrong with This Multiple Join with Conditions on The Associations
How to Send an Image on The Web in an Xmpp (Jabber) Message
How to Directly Install a Gem from a Git Repository
Using Rails Form Helpers with Serialized Custom Classes
Require Tree in Asset Pipeline
Reading Files in a Zip Archive, Without Unzipping The Archive
Filtering Sensitive Data with Vcr
Ruby Rspec. Get List of All Test
Fresh Ruby Gem from Bundler - Cannot Load My Version.Rb File