我正在使用carrierwave 将图像上传到我的项目,并在此处与 Ryan Bates railscasts 一起使用。
我正在使用 ruby 1.9.2p290 (2011-07-09) [i386-mingw32] 和 rails 3.1.0
在这一集中它说为了使用 rmagick 你必须像这样将它安装在你的 gemfile 中
宝石文件
gem 'rmagick'
然后运行 bundle install 我得到错误
Installing rmagick (2.13.1) with native extensions C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:533:in `rescue in block in build_extensions': ERROR
: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
C:/Ruby192/bin/ruby.exe extconf.rb
checking for Ruby version >= 1.8.5... yes
Invalid drive specification.
Unable to get ImageMagick version
*** 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:/Ruby192/bin/ruby
所以我用谷歌搜索了 Unable to get ImageMagick version 并在这里找到了这个链接并按照说明下载了 RMagick-2.13.1.tar.gz,解压到 c:\rmagick,然后运行
ruby setup.rb command
并得到以下错误。
c:\RMagick-2.13.1>ruby setup.rb
---> lib
---> lib/rvg
<--- lib/rvg
<--- lib
---> ext
---> ext/RMagick
C:/Ruby192/bin/ruby.exe c:/RMagick-2.13.1/ext/RMagick/extconf.rb
checking for Ruby version >= 1.8.5... yes
Invalid drive specification.
Unable to get ImageMagick version
*** c:/RMagick-2.13.1/ext/RMagick/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.
再次出现错误无法获取 ImageMagick 版本。我认为 Imagemagick 与 Windows 安装捆绑在一起。有人对此事有任何帮助吗?