how to make "gem install rmagick" work?

Discussion in 'Ruby' started by Jian Lin, Jul 21, 2010.

  1. Jian Lin

    Jian Lin Guest

    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>'
    --
    Posted via http://www.ruby-forum.com/.
    Jian Lin, Jul 21, 2010
    #1
    1. Advertising

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

    On Wed, Jul 21, 2010 at 11:39 AM, Jian Lin <> wrote:

    > 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.

    --
    http://richardconroy.blogspot.com
    Richard Conroy, Jul 21, 2010
    #2
    1. Advertising

  3. Jian Lin

    Luis Lavena Guest

    On Jul 21, 7:39 am, Jian Lin <> wrote:
    > 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
    --
    Luis Lavena
    Luis Lavena, Jul 21, 2010
    #3
  4. 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.
    --
    Posted via http://www.ruby-forum.com/.
    Guillaume Bloss, Jul 21, 2010
    #4
  5. Jian Lin

    Roger Pack Guest

    winter heat wrote:
    > 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
    --
    Posted via http://www.ruby-forum.com/.
    Roger Pack, Jul 21, 2010
    #5
  6. Jian Lin

    Luis Lavena Guest

    On Jul 21, 12:50 pm, Guillaume Bloss <> wrote:
    > 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

    --
    Luis Lavena
    Luis Lavena, Jul 21, 2010
    #6
  7. On Wed, Jul 21, 2010 at 4:04 AM, Richard Conroy
    <> wrote:
    > 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
    Charles Oliver Nutter, Jul 22, 2010
    #7
  8. There are already opened issues under RMagick for 1.9.1 and Windows:
    http://rubyforge.org/tracker/index.php?func=detail&aid=27765&group_id=12&atid=134
    http://rubyforge.org/tracker/index.php?func=detail&aid=6065&group_id=12&atid=134

    I succeeded some time ago compiling RMagick to Ruby 1.9.1 by using
    instructions at http://www.waydotnet.com/blog/2010/02/rmagick-on-ruby-1-9-1-i386-mingw32-work-d/

    Jarmo


    On Jul 22, 8:41 am, Charles Oliver Nutter <> wrote:
    > On Wed, Jul 21, 2010 at 4:04 AM, Richard Conroy
    >
    > <> wrote:
    > > 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
    Jarmo Pertman, Jul 22, 2010
    #8
  9. > I succeeded some time ago compiling RMagick to Ruby 1.9.1 by using
    > instructions at
    > http://www.waydotnet.com/blog/2010/02/rmagick-on-ruby-1-9-1-i386-mingw32-work-d/



    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
    --
    Posted via http://www.ruby-forum.com/.
    Guillaume Bloss, Jul 22, 2010
    #9
  10. Guillaume Bloss wrote:
    > 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
    --
    Posted via http://www.ruby-forum.com/.
    Abder-Rahman Ali, Sep 6, 2010
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Asbach
    Replies:
    1
    Views:
    466
    Leo Kislov
    Nov 3, 2006
  2. Replies:
    4
    Views:
    341
    Juha Nieminen
    Nov 24, 2007
  3. ali khanbaba
    Replies:
    0
    Views:
    460
    ali khanbaba
    Jun 2, 2009
  4. Xeno Campanoli
    Replies:
    1
    Views:
    338
    James Britt
    Jul 1, 2005
  5. Pito Salas
    Replies:
    1
    Views:
    137
    Tim Hunter
    Apr 24, 2009
Loading...

Share This Page