RMagick with JRuby on Windows

Added by Cassiano Monteiro about 6 years ago

Hello guys!

If someone can help me, I would really appreciate it!

I´m running Redmine 2.4.2 on Windows XP with Apache 2.4, JRuby 1.7.2 (with the devkit) and puma. I managed to install ImageMagick, but it seems that the RMagick gem is somewhat not compatible with JRuby.

When I try to install it, I get this message:

C:\Documents and Settings\arielo>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:/webserver/jruby/bin/jruby.exe extconf.rb
C:/webserver/jruby/lib/ruby/shared/mkmf.rb:14: Use RbConfig instead of obsolete
and deprecated Config.
mkmf.rb can't find header files for ruby at C:/webserver/jruby/lib/native/includ
e/ruby/ruby.h

Gem files will remain installed in C:/webserver/jruby/lib/ruby/gems/shared/gems/
rmagick-2.13.2 for inspection.
Results logged to C:/webserver/jruby/lib/ruby/gems/shared/gems/rmagick-2.13.2/ex
t/RMagick/gem_make.out

When I try to install from the downloaded sources, I get this:

C:\webserver\RMagick>jruby setup.rb
setup.rb:768: Use RbConfig instead of obsolete and deprecated Config.
---> lib
---> lib/rvg
<--- lib/rvg
<--- lib
---> ext
---> ext/RMagick
C:/webserver/jruby/bin/jruby.exe C:/webserver/RMagick/ext/RMagick/extconf.rb
C:/webserver/jruby/lib/ruby/shared/mkmf.rb:14: Use RbConfig instead of obsolete
and deprecated Config.
mkmf.rb can't find header files for ruby at C:/webserver/jruby/lib/native/includ
e/ruby/ruby.h
RuntimeError: system("C:/webserver/jruby/bin/jruby.exe" "C:/webserver/RMagick/ex
t/RMagick/extconf.rb") failed
             command at setup.rb:656
                ruby at setup.rb:660
             extconf at setup.rb:1238
      config_dir_ext at setup.rb:1230
            traverse at setup.rb:1532
           dive_into at setup.rb:1549
            traverse at setup.rb:1530
            traverse at setup.rb:1534
  exec_task_traverse at setup.rb:1519
         exec_config at setup.rb:1223
         exec_config at setup.rb:991
              invoke at setup.rb:812
              invoke at setup.rb:772
              (root) at setup.rb:1578

And when I try to install the binary file locally, I get this (seems like there is a cyclical dependency to the gem itself):

C:\webserver>gem install --local rmagick-2.12.0-x86-mswin32.gem
ERROR:  While executing gem ... (Gem::UnsatisfiableDependencyError)
    Unable to resolve dependency: (unknown) requires rmagick (= 2.12.0)

Can anyone help? Thanks!

Replies (8)

RE: RMagick with JRuby on Windows - Added by Ivan Cenov about 6 years ago

See here

Did you set the paths CPATH and LIBRARY_PATH ?

RE: RMagick with JRuby on Windows - Added by Cassiano Monteiro about 6 years ago

Hello Ivan,

Yes, I tried that, and also tried with the additional options, as the command below:

C:\webserver\Redmine>gem install rmagick -- --with-opt-lib=c:/webserver/ImageMag
ick/lib --with-opt-include=c:\webserver\ImageMagick\include
Temporarily enhancing PATH to include DevKit...
Building native extensions with: '--with-opt-lib=c:/webserver/ImageMagick/lib --
with-opt-include=c:\webserver\ImageMagick\include'
This could take a while...
ERROR:  Error installing rmagick:
        ERROR: Failed to build gem native extension.

    C:/webserver/jruby/bin/jruby.exe extconf.rb --with-opt-lib=c:/webserver/Imag
eMagick/lib --with-opt-include=c:\webserver\ImageMagick\include
C:/webserver/jruby/lib/ruby/shared/mkmf.rb:14: Use RbConfig instead of obsolete
and deprecated Config.
mkmf.rb can't find header files for ruby at C:/webserver/jruby/lib/native/includ
e/ruby/ruby.h

Gem files will remain installed in C:/webserver/jruby/lib/ruby/gems/shared/gems/
rmagick-2.13.2 for inspection.
Results logged to C:/webserver/jruby/lib/ruby/gems/shared/gems/rmagick-2.13.2/ex
t/RMagick/gem_make.out

It's missing ruby header files, and indeed they are not there. How can I get them, as they are not installed along jruby?

On the link below, it seems that JRuby doesn´t support C-extensions, and gives an alternative for RMagick (RMagick4J). Can I use it with Redmine?

https://github.com/jruby/jruby/wiki/C-Extension-Alternatives

Thanks a lot!

RE: RMagick with JRuby on Windows - Added by Ivan Cenov about 6 years ago

Unfortunately, I use Ruby 1.9.3 and have never tried JRuby. I had an installation problem because had forgotten CPATH and LIBRARY_PATH and thought now that this could be your problem too. I'm sorry I cannot provide further help -- I have no experience with JRuby.

RE: RMagick with JRuby on Windows - Added by Cassiano Monteiro about 6 years ago

Thanks for your help Ivan! Actually, I ended giving up on JRuby and installed Ruby 2.0.0, and it worked. But Redmine still didn't detect it on the Information page:

Even having RMagick gem installed on my gem list, it's not working... any hits? Thanks!

*** LOCAL GEMS ***
actionmailer (3.2.16)
actionpack (3.2.16)
activemodel (3.2.16)
activerecord (3.2.16)
activeresource (3.2.16)
activesupport (3.2.16)
arel (3.0.3)
bigdecimal (1.2.0)
builder (3.0.0)
bundler (1.5.2)
coderay (1.1.0)
erubis (2.7.0)
hike (1.2.3)
i18n (0.6.9)
io-console (0.4.2)
journey (1.0.4)
jquery-rails (2.0.3)
json (1.8.1, 1.7.7)
mail (2.5.4)
mime-types (1.25.1)
minitest (4.3.2)
multi_json (1.8.4)
mysql2 (0.3.14)
net-ldap (0.3.1)
polyglot (0.3.3)
psych (2.0.0)
puma (2.7.1)
rack (1.4.5)
rack-cache (1.2)
rack-openid (1.4.1)
rack-ssl (1.3.3)
rack-test (0.6.2)
rails (3.2.16)
railties (3.2.16)
rake (10.1.1, 0.9.6)
rdoc (4.0.0, 3.12.2)
rmagick (2.13.2)
ruby-openid (2.3.0)
sprockets (2.2.2)
test-unit (2.0.0.0)
thor (0.18.1)
tilt (1.4.1)
treetop (1.4.15)
tzinfo (0.3.38)

RMagick_Issue.png (11.3 KB)

RE: RMagick with JRuby on Windows - Added by Cassiano Monteiro about 6 years ago

I forgot that I had myself submitted an issue on this: #10724-3. That fix of running bundle install again still works!

Thanks for your help!

RE: RMagick with JRuby on Windows - Added by Ivan Cenov about 6 years ago

I use ImageMagick-6.8.0-3-Q16-windows-dll.exe. I do not remember clearly how dealt with it... it was 12.2012. There were newer versions of RMagick and there were some problems with them ... I am not sure.

Is RMagick installation directory in PATH= ? Did you restart Windows?

RE: RMagick with JRuby on Windows - Added by Cassiano Monteiro about 6 years ago

Yes, now it´s working with the #10724-3. Thanks!

RE: RMagick with JRuby on Windows - Added by Esa Wang over 3 years ago

hello guys,

where can find "rmagick-2.14.0-x86-mswin32.gem" file.
I can't find "rmagick-2.14.0-x86-mswin32.gem" on ImageMagick-XXXX.zip from the official web site.

(1-8/8)