Won't Let Me Install Gem in Ruby Prompt

前端 未结 4 1116
小鲜肉
小鲜肉 2021-01-07 08:41

Windows Vista, Ruby v. 3.3.5

C:\\>gem install rmagick

Building native extensions.  This could take a while...

ERROR:  Error installing rmagick:
                 


        
相关标签:
4条回答
  • 2021-01-07 08:58

    Download this rmagick-2.13.2.gem gem and save in you local.

    Open the repository in cmd prompt where the gem file is located and run the following cmd

    gem install rmagick-2.13.2.gem --platform=ruby --with-opt-lib=C:/ImageMagick-6.6.7-Q16/lib --with-opt-include=c:/ImageMagick-6.6.7-Q16/include
    
    0 讨论(0)
  • 2021-01-07 09:01

    You can get rmagick to compile on Windows with the command:

    gem install rmagick -- '--with-opt-dir="[path to ImageMagick]"'
    

    There are three noteworthy things about this command:

    1. There's a double-dash separating "rmagick" and the --with-opt-dir option
    2. The --with-opt-dir option is surrounded by single-quotes
    3. The path to the ImageMagick directory is surrounded by double-quotes

    You can have spaces in the path to the ImageMagick directory if you use this syntax. I think the path also doesn't care about forward or backward slashes, but I use backslashes.

    You also have to make sure of two other things:

    1. ImageMagick was installed with the development headers option (installs lib and include directories)
    2. ImageMagick is first in your system path

    If ImageMagick isn't first in your system path, you'll get an "Invalid drive specification" error when extconf.rb tries to identify the ImageMagick version.

    All that said, I've experienced failures to build with some version pairings of rmagick and ImageMagick. I was able to get ImageMagick 6.7.7 and rmagick 2.13.1 to build together on both Windows 7 and Server 2003.

    0 讨论(0)
  • 2021-01-07 09:03

    On Windows, you should use the rmagick-win32 gem.

    http://rmagick.rubyforge.org/install-faq.html#win

    0 讨论(0)
  • 2021-01-07 09:10

    A simple google search yielded one very promising result: rmagick on windows. By the way, I guess you are using something like Ruby 1.8.5/1.8.7, but surely not 3.3.5 ( if you do, please let me join you in your time-travel adventures. We could be friends! )

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