Gem Rmagick install error: extconf.rb:171:in ``': No such file or directory - convert -version (Errno::ENOE NT)

六月ゝ 毕业季﹏ 提交于 2019-12-10 20:05:54

问题


I get this error when installing rmagick, I have followed all kind of guides and get the same error every time. This time I have followed this guide: http://www.youtube.com/watch?v=gEWAVlNCKhg&feature=youtu.be :

   C:/Ruby192/bin/ruby.exe extconf.rb --with-opt-include=C:/ImageMagick/Sou
    rceCode --with-opt-lib=C:/ImageMagick
    checking for Ruby version >= 1.8.5... yes
    *** 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=${opt-dir}/include
            --with-opt-lib=${opt-dir}/lib
            --with-make-prog
            --without-make-prog
            --srcdir=.
            --curdir
            --ruby=C:/Ruby192/bin/ruby
    extconf.rb:171:in ``': No such file or directory - convert -version (Errno::ENOE
    NT)
            from extconf.rb:171:in `<main>'


    Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/rmagick-2
    .13.1 for inspection.
    Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1/ext/RMagick
    /gem_make.out

    c:\>

回答1:


According to the error:

extconf.rb:171:in ``': No such file or directory - convert -version
(Errno::ENOENT)

it would appear that you don't have Imagemagick (or an equivalent) installed. The main application in the Imagemagick suite is the convert binary. If you're certain you do have it installed, then you should check that it's accessible in the PATH.




回答2:


First I thought I should set the environment variables in the system.

But setting these variables in the command view:

set DFImageMagick = C:\ImageMagick
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%

And then running the command gem install rmagick

And the gem was installed without any errors!



来源:https://stackoverflow.com/questions/10305781/gem-rmagick-install-error-extconf-rb171in-no-such-file-or-directory-co

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!