执行“bundle install”时报错:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
D:/develop/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rmagick-2.16.0/ext/RMagick
D:/develop/Ruby23-x64/bin/ruby.exe -r ./siteconf20170810-1028-1n1pw1i.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=D:/develop/Ruby23-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
D:/develop/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rmagick-2.16.0 for inspection.
Results logged to
D:/develop/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/rmagick-2.16.0/gem_make.out
An error occurred while installing rmagick (2.16.0), and Bundler cannot
continue.
Make sure that `gem install rmagick -v '2.16.0'` succeeds before bundling.
In Gemfile:
rmagick
然后我在网上找了一些资料,说是要先安装“ImageMagick”,我下载安装之后,执行 gem install rmagick -- '--with-opt-dir="C:/Program Files/ImageMagick-7.0.6-Q16"'还是报错:
Temporarily enhancing PATH to include DevKit...
Building native extensions with: '--with-opt-dir="C:/Program Files/ImageMagick-7.0.6-Q16"'
This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
current directory: D:/develop/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rmagick-2.16.0/ext/RMagick
D:/develop/Ruby23-x64/bin/ruby.exe -r ./siteconf20170810-5204-f29kli.rb extconf.rb --with-opt-dir="C:/Program Files/ImageMagick-7.0.6-Q16"
*** 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
--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=D:/develop/Ruby23-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 D:/develop/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rmagick-2.16.0 for inspection.
Results logged to D:/develop/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/rmagick-2.16.0/gem_make.out
尤其是这一句:
extconf.rb:141:in ``': No such file or directory - identify -version (Errno::ENOENT)
好像跟别人的不一样,但实在找不出哪里出错了,请大家帮忙看看,谢谢!