Ruby 1.9.2 how to install RMagick on Windows?

前端 未结 6 622
别跟我提以往
别跟我提以往 2020-12-01 01:08

I\'m currently upgrading an old rails app to use Rails 3 and Ruby 1.9.2, and RMagick is the last gem I need to install. However there doesn\'t seem to be any 1.9.2 download

相关标签:
6条回答
  • 2020-12-01 01:29

    After some attempts, this finally worked for me:

    1. Install DevKit : https://github.com/oneclick/rubyinstaller/wiki/Development-Kit

    2. Install ImageMagick (tick yes for headers in the installer) to a folder without spaces in its path (i used C:/ImageMagick)

    3. Open up mingw (msys.bat in DevKit folder) -- and run gem install rmagick --platform=ruby -- --with-opt-lib=c:/ImageMagick/lib --with-opt-include=c:/ImageMagick/include (replace the two paths to account for your imagemagick path if needed)

    0 讨论(0)
  • 2020-12-01 01:35

    Srividya's solution also works with ImageMagick-6.7.0-8-Q16-windows-dll and RMagick 2.13.1.
    Make sure you are using 32-bit version of ImageMagick if this doesn't work for you on 64-bit version of Windows.
    I did, and it works.

    0 讨论(0)
  • 2020-12-01 01:38

    I just installed RMagick 2.13.1 successfully on Windows with Ruby v1.9.x !

    Let me spill out the procedure, before I forget.

    1. Install DevKit : https://github.com/oneclick/rubyinstaller/wiki/Development-Kit .
    2. Install ImageMagick 6.6.x with windows installer with headers.
      NOTE:
      -Do not install ImageMagick in a path which has spaces in it.
      The default path C:/Program Files/... will not work.
      Install it at a simpler path.
      -- Remove any older installations of ImageMagick and RMagick
    3. Set the paths in Environment Variables:

      set DFImageMagick environment variable to where ImageMagick is installed
      set PATH=%DFImageMagick%;%PATH% (if you don't already have it in PATH)
      set CPATH=%DFImageMagick%\include;%CPATH%
      set LIBRARY_PATH=%DFImageMagick%\lib;%LIBRARY_PATH%

    4. Install RMagick gem : gem install rmagick
      This should say, Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... After some time, Successfully installed rmagick 2.13.1

    5. Verify installation:

      A. convert -version
      this should give the ImageMagick installation version
      B. gem list --local should list rmagick 2.13.1
      Alternative: in irb, try
      require 'rmagick'
      it should return 'true'

    Oh, I do like installations which complete in 5 steps.

    Hope this works for you and others.

    ref:

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

    http://www.waydotnet.com/blog/2010/02/rmagick-on-ruby-1-9-1-i386-mingw32-work-d/#link text

    0 讨论(0)
  • 2020-12-01 01:40

    I believe there are a few gotchas with RMagick and 1.9, as discussed in this thread at RubyInstaller group.

    However, here you can find a post describing the steps.

    Other tutorials can be found in our wiki

    Hope that helps

    0 讨论(0)
  • 2020-12-01 01:42
    • Installed rmagick in c:\rmagick.. folder

    And tried the following command and it works:

    gem install rmagick --platform=ruby -- --with-opt-lib=C:\ImageMagick-6.8.6-Q16\lib --with-opt-include=c:\ImageMagick-6.8.6-Q16\include
    
    0 讨论(0)
  • 2020-12-01 01:46

    This did the trick for me using ruby 2.0:

    $ gem install rmagick --platform=ruby -- --with-opt-lib=C:/RailsInstaller/ImageMagick-6.7.7-Q8/lib --with-opt-include=c
    :/RailsInstaller/ImageMagick-6.7.7-Q8/include 
    

    make sure to specify your own version of ImageMagick and the file path you installed it in & include the lib folder on the command

    0 讨论(0)
提交回复
热议问题