2017-04-03 115 views
1

我在安裝名爲rmagick的gem時出錯。我已經看到其他堆棧溢出網站關於同一問題。但沒有工作。ImageMagick:錯誤:無法構建gem原生擴展

錯誤:

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. 

    current directory: C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rmagick-2.16.0/ext/RMagick 
C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20170403-8836-1ebgkj8.rb extconf.rb 
*** 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 
     --without-opt-include=${opt-dir}/include 
     --with-opt-lib 
     --without-opt-lib=${opt-dir}/lib 
     --with-make-prog 
     --without-make-prog 
     --srcdir=. 
     --curdir 
     --ruby=C:/Ruby22-x64/bin/$(RUBY_BASE_NAME) 
extconf.rb:141:in ``': No such file or directory - identify -version (Errno::ENOENT) 
     from extconf.rb:141:in `configure_compile_options' 
     from extconf.rb:16:in `initialize' 
     from extconf.rb:548:in `new' 
     from extconf.rb:548:in `<main>' 

extconf failed, exit code 1 

Gem files will remain installed in C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rmagick-2.16.0 for inspection. 
Results logged to C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/rmagick-2.16.0/gem_make.out 

C:\Users\suresh>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. 

    current directory: C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rmagick-2.16.0/ext/RMagick 
C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20170403-7540-1x6tan0.rb extconf.rb 
*** 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 
     --without-opt-include=${opt-dir}/include 
     --with-opt-lib 
     --without-opt-lib=${opt-dir}/lib 
     --with-make-prog 
     --without-make-prog 
     --srcdir=. 
     --curdir 
     --ruby=C:/Ruby22-x64/bin/$(RUBY_BASE_NAME) 
extconf.rb:141:in ``': No such file or directory - identify -version (Errno::ENOENT) 
     from extconf.rb:141:in `configure_compile_options' 
     from extconf.rb:16:in `initialize' 
     from extconf.rb:548:in `new' 
     from extconf.rb:548:in `<main>' 

extconf failed, exit code 1 

Gem files will remain installed in C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rmagick-2.16.0 for inspection. 
Results logged to C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/rmagick-2.16.0/gem_make.out 

我實際上沒有,步驟3和步驟4輸出上述相同的錯誤。

1.Downloaded ImageMagick-7.0.5-4-Q16-x64-dll 
    2.Set my Path to C:\Program Files (x86)\ImageMagick-7.0.5-Q16\include 
    set 
    3.Install the gem using this command: 
     gem install rmagick --platform=ruby -- --with-opt-lib=C:\ImageMagick-7.0.5-Q16\lib --with-opt-include=C:\ImageMagick-7.0.5-Q16\include 
    4. or gem install rmagick 
    5. Using Windows 10 machine 

回答

0

玉傢伙我設法安裝它。

請遵循本指南。

1步:下載並安裝此

ImageMagick-6.9.8-3-Q16-HDRI-x64-dl 

第2步:設置並創建一個新的環境變量叫做CLASSPATH和值將其設置爲

.;C:\ImageMagick-6.9.8-Q16-HDRI\include;lib C:\ImageMagick-6.9.8-Q16-HDRI\lib 

第3步:寶石安裝

gem install rmagick --platform=ruby -- --with-opt-lib=C:\ImageMagick-6.9.8-Q16-HDRI\lib --with-opt-include=C:\ImageMagick-6.9.8-Q16-HDRI\include 

重要注意!

,當你下載和安裝的ImageMagick確保您設置您的路徑和創業板安裝時準確鍵入版本號。

實施例一樣ImageMagic-6.9.8-3-Q16-HDRI,遵循完全相同。

0

RMagick似乎還不支持ImageMagick 7。嘗試安裝rmagick與最新版本的ImageMagick 6.9。

+0

我安裝了7及以下版本。仍然不能 – Suresh

+0

告訴我你的配置,你得到這個錯誤。 –

+0

@Suresh http://rubyinstaller.org/downloads/向下滾動並下載**開發工具包**爲您的紅寶石 –

相關問題