2011-07-31 54 views
2

我想在Windows上安裝rmagick for rails應用程序。在Windows上rmagick問題

我已經下載了以下文件,並按照說明:
http://rubyforge.org/frs/download.php/64917/RMagick-2.12.0-ImageMagick-6.5.6-8-Q8.zip

如果我運行IRB和require 'rubygems'; require 'RMagick',它的確定。
但如果我require 'RMagick'在軌控制檯,它給了我下面的錯誤:

irb(main):001:0> require 'RMagick' 
LoadError: no such file to load -- RMagick 
     from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/activesupport-3. 
0.4/lib/active_support/dependencies.rb:239:in `require' 
     from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/activesupport-3. 
0.4/lib/active_support/dependencies.rb:239:in `require' 
     from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/activesupport-3. 
0.4/lib/active_support/dependencies.rb:225:in `load_dependency' 
     from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/activesupport-3. 
0.4/lib/active_support/dependencies.rb:596:in `new_constants_in' 
     from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/activesupport-3. 
0.4/lib/active_support/dependencies.rb:225:in `load_dependency' 
     from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/activesupport-3. 
0.4/lib/active_support/dependencies.rb:239:in `require' 
     from (irb):1 

這是爲什麼?

回答

2

先決條件:
紅寶石> 1.8.6
的devkit(任何版本)
沒有其他的ImageMagick安裝或PATH條目

步驟1: 安裝的ImageMagick:

下載的ImageMagick: http://imagemagick.spd.co.il/binaries/ImageMagick-6.8.0-3-Q16-windows-dll.exe

安裝ImageMagick:
* Importan t:安裝路徑不應包含任何空格。
理想選擇「C:\ ImageMagick的「

請務必選擇下方的選項:

Add application directory to your path system
Install development headers and libraries for C and C++

步驟2: 安裝rmagick:

使用下面的命令來安裝rmagick寶石:

gem install rmagick --platform=ruby -- --with-opt-lib=c:/ImageMagick/lib --with-opt-include=c:/ImageMagick/include 

via-

http://shoobm.wordpress.com/2013/01/03/installing-rmagick-gem-on-windows-7/