Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rmagick under windows

I just wanted to install rmagick under windows.

So I installed ImageMagick with C/C++ header, but that seems no more to be necessary.

Then I installed the Ruby Build Tools

ruby dk.rb init
ruby dk.rb install

Then I wanted to install the rmagick gem with gem install rmagick.

But I get this error:

H:\Downloads\ruby build tools>gem install rmagick
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
        ERROR: Failed to build gem native extension.

        C:/Ruby192/bin/ruby.exe extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for stdint.h... *** 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
C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate 
an executable file. (RuntimeError)
You have to install development tools first.
        from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp'
        from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:834:in `block in have_header'
        from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
        from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone'
        from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open'
        from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
        from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open'
        from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
        from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
        from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:833:in `have_header'
        from extconf.rb:193:in `<main>'

Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1 
for inspection.
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1/ext/RMagick/gem_make.out

Before I installed the Build Tools, I just got the advice to install them.

Now they are installed and I get a different error message than before (see above).

It still wants me to install the Build Tools, so its installation might be broken?

I get the same error with linecache... also something with the mkmf file and build tools.

I guess this is a common error.

like image 287
Joern Akkermann Avatar asked Feb 14 '11 05:02

Joern Akkermann


People also ask

How do I install Rmagick gem?

Installation of the rmagick gemOpen a new command prompt. Install the gem by running bundle install . Note: bundler remembers the list of groups to skip set with --without option. If you have already run bundler install --without rmagick , you'll need to modify redmine\.

What is Rmagick?

RMagick is a binding from Ruby to the ImageMagick TM image manipulation library.

What is Rmagick gem?

RMagick is an interface between Ruby and ImageMagick.


2 Answers

I had to install Ruby on Rails first, and then from the Command Prompt with Ruby and Rails, I ran:

gem install rmagick --platform=ruby -- --with-opt-dir=C:\ImageMagick

It all worked, and I saw this:

Fetching: rmagick-2.13.2.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed rmagick-2.13.2
1 gem installed
Installing ri documentation for rmagick-2.13.2...
Installing RDoc documentation for rmagick-2.13.2...

Windows 7 64bit, but installed the 32-bit version of ImageMagick to C:\ImageMagick

like image 123
Bogdan Varlamov Avatar answered Sep 28 '22 07:09

Bogdan Varlamov


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.

like image 42
Darme Avatar answered Sep 28 '22 05:09

Darme