Can't install Rmagick and Imagemagick on Windows 7

前端 未结 5 1813
礼貌的吻别
礼貌的吻别 2021-02-08 15:25

when I run gem install rmagick-2.13.1.gem from the directory in which rmagick-2.13.1.gem is I get an Error saying that it failed to build gem native extension, belo

5条回答
  •  青春惊慌失措
    2021-02-08 16:14

    First of all clear your path environment variables. (This is the main step that people often skip, but very important). This is the main reason for the error you're facing.

    Then install the rails installer (2.0.0) from here : http://railsinstaller.org/en

    It'll set up ruby, rails, and everything else you need. This will also set up your environment path variables for you as well.

    Next install imagemagick 6.7.9.9 or lower and while installing check the option to include C headers. Make sure you install it within the rails installer folder.

    Then type this in your command prompt path=c:\RailsInstaller\ImageMagick-6.7.9-Q8;%path% or whatever version you have.

    Then type

    gem install rmagick -- '--with-opt-dir="c:\RailsInstaller\ImageMagick-6.7.9-Q8"'
    

    Finally edit C:\RailsInstaller\Ruby2.0.0\setup_environment.bat to include the path to ImageMagic

    At line 25: SET PATH=c:\RailsInstaller\ImageMagick-6.7.9-Q8; or whatever version you have

提交回复
热议问题