私はcarrierwaveを使用して画像をプロジェクトにアップロードしており、RyanBatesのrailscastsもここにあります。
私はruby1.9.2p290(2011-07-09)[i386-mingw32]とrails3.1.0を使用しています。
エピソードでは、rmagickを使用するには、gemfileに次のようにインストールする必要があると書かれています。
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
そこで、「ImageMagickを取得できません」バージョンをグーグルで検索し、ここでこのリンクを見つけて指示に従い、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のインストールにバンドルされていると思いました。誰かがこの問題について何か助けがありますか?