how to make "gem install rmagick" work?

J

Jian Lin

I wanted to install rmagick on Win7 but it can't install:
Is there any way to make it work?

C:\>gem list -r rmagick

*** REMOTE GEMS ***

rmagick (2.13.1)
rmagick4j (0.3.7, 0.3.4 java)


C:\>gem install rmagick
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.

c:/ruby/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:/ruby/bin/ruby


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


C:\>ruby try.rb
c:/ruby/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1/lib/RMagick.rb:11:in
`require': no such file to load
-- RMagick2.so (LoadError)
from
c:/ruby/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1/lib/RMagick.rb:11:in
`<top (required)>'

from try.rb:3:in `require'
from try.rb:3:in `<main>'
 
R

Richard Conroy

[Note: parts of this message were removed to make it a legal post.]

I wanted to install rmagick on Win7 but it can't install:
Is there any way to make it work?

C:\>gem list -r rmagick
The rmagick dependencies are a challenge to install on Windows (and other
platforms as well).
You will need to visit the project page and review the full instructions
(which are quite extensive).

RMagick is probably the most difficult gem to install on Windows that
actually works on it.

Alternatively the JRuby gem rmagick4j uses a completely different native
library to do the rendering
activities (Batik I think). As a result, its installation process is
considerably easier.

C;\>jruby -S gem install rmagick4j

I don't know if there are any API level discrepancies between rmagick and
rmagick4j however.
 
L

Luis Lavena

I wanted to install rmagick on Win7 but it can't install:
Is there any way to make it work?

    C:\>gem list -r rmagick

    *** REMOTE GEMS ***

    rmagick (2.13.1)
    rmagick4j (0.3.7, 0.3.4 java)

    C:\>gem install rmagick
    Building native extensions.  This could take a while...
    ERROR:  Error installing rmagick:
            ERROR: Failed to build gem native extension.

RMagick compilation process is quite complicated, worse under Windows.

Please download the zip file that contains both the binary gem and the
correct precise ImageMagick version used to create the gem.

Read here for instructions:

http://rubyforge.org/frs/shownotes.php?release_id=39888

HTH
 
G

Guillaume Bloss

I tried to install the rmagick_win32.zip but actually it does not works
with ruby 1.9.1 ...

I will try to compile it to get a working version with ruby1.9.1, but it
seems to be a very long work since I have to configure all depending
libraries by myself ... and also I cant be sure it will works, but well
it's a challenge, I work with windows and hate use old slow version ...

I think I can try to download all sources of all required libraries and
try to compile it with mingw, following the linux instruction, but under
windows.
 
R

Roger Pack

winter said:
I wanted to install rmagick on Win7 but it can't install:
Is there any way to make it work?

C:\>gem list -r rmagick

*** REMOTE GEMS ***

rmagick (2.13.1)
rmagick4j (0.3.7, 0.3.4 java)


C:\>gem install rmagick
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.

c:/ruby/bin/ruby.exe extconf.rb
checking for Ruby version >= 1.8.5... yes
Invalid drive specification.

I've never seen that specific error message, but have had success
getting it to build.
I'm assuming you're using a rubyinstaller build of ruby.
If so, install the devkit, then look for instructions on the gem list
http://wiki.github.com/oneclick/rubyinstaller/gem-list

specifically here are my own:
http://betterlogic.com/roger/?p=2186

@luis
Unfortunately the binary gems released by the rmagick team on rubyforge
are 1.8.x only, last time I checked. Of course it's been awhile since I
checked.

GL.
-r
 
L

Luis Lavena

I tried to install the rmagick_win32.zip but actually it does not works
with ruby 1.9.1 ...

It clearly states that the gem is Ruby 1.8, not 1.9.1
I will try to compile it to get a working version with ruby1.9.1, but it
seems to be a very long work since I have to configure all depending
libraries by myself ... and also I cant be sure it will works, but well
it's a challenge, I work with windows and hate use old slow version ...

Developer need to provide binaries for Ruby 1.9 since they link to
different Ruby runtime libraries.

Try first asking about it in the RubyForge page
I think I can try to download all sources of all required libraries and
try to compile it with mingw, following the linux instruction, but under
windows.

I believe you can build and link with binaries of ImageMagick as long
they provide header and libs needed.

By this error:

"Invalid drive specification.
Unable to get ImageMagick version
*** extconf.rb failed *** "

It is clear that is trying to look for an ImageMagick executable to
get the version, investigate inside extconf.rb to see what is doing.

I can't help you more on this since I'm not familiar with ImageMagick
build process or internals.

Trying to fix gems to compile cleanly is a challenging task. Feel free
to jump for help at RubyInstaller project group:

http://groups.google.com/group/rubyinstaller
 
C

Charles Oliver Nutter

Alternatively the JRuby gem rmagick4j uses a completely different native
library to do the rendering
activities (Batik I think). As a result, its installation process is
considerably easier.

C;\>jruby -S gem install rmagick4j

I don't know if there are any API level discrepancies between rmagick and
rmagick4j however.

rmagick4j is definitely incomplete, but sometimes it has enough for
individual use cases.

And FWIW, it just uses Java2D libraries shipped with every JDK/JVM, so
there shouldn't be any external dependencies (if I remember right).

Also of interest: rmagick almost installs and works now with JRuby's
new C extension support, thanks to Tim Felgentreff...though of course
the native library issues that prevent running on Windows are no
different for us. Native sux.

- Charlie
 
G

Guillaume Bloss

I succeeded some time ago compiling RMagick to Ruby 1.9.1 by using


succeed too, with ruby 1.9.1p429, and last imagemagick
version(6.6.3-0-Q16). That was easy in fact (not mentioning the 1h30 my
computer take to install the rdoc ...)

I just followed the tuto on www.waydotnet.com, works fine. I made a gem,
but did not try on other version of ruby.

I'm not sure of that, but you should install imagemagick, and set
imagemagic in the path, with the imagemagic version used to build your
gem
 
A

Abder-Rahman Ali

Guillaume said:
I tried to install the rmagick_win32.zip but actually it does not works
with ruby 1.9.1 ...

I will try to compile it to get a working version with ruby1.9.1, but it
seems to be a very long work since I have to configure all depending
libraries by myself ... and also I cant be sure it will works, but well
it's a challenge, I work with windows and hate use old slow version ...

I think I can try to download all sources of all required libraries and
try to compile it with mingw, following the linux instruction, but under
windows.

Check this thread: http://www.ruby-forum.com/topic/204353#new
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top