Carrierwave Is Not Loading RMagick

Hello, I'm using Carrierwave to upload images. I'm on windows vista using ruby192. I've downloaded the windows versions of imagemagick and rmagick and followed the instructions in the readme. I have set my path variables to my installations.

I can access identify in the command line so I know imagemagick is working. I can even convert in the command line.

But when I start my server and try to access my application in the browser I get:

no such file to load -- RMagick

When I type "gem list" in the CLI it shows I have rmagick installed:

rmagick (2.12.0 mswin32)

Is this maybe because I don't have rmagick in my gemfile? Is there a way to make my gem file use this specific version of rmagick for 2.12.0 mswin32? Because when I put just

gem 'rmagick'

and run bundle I get errors, I think I need to tell it to include this specific gem because its for windows.

Thanks for any help.

Rails on Windows is a painful process isn't it?

I had some dealings with rmagick which were mitigated by using Paperclip.

I did find this though -

Hope this helps

If you have the computer horsepower (Virtualbox) or the ability to dual boot - get a Linux distro to develop with.

Try use mini_magick

gem ‘mini_magick’

and replace

include CarrierWave::RMagick

by

include CarrierWave::MiniMagick

on uploader file

Thanks guys.

@Agoofin

Thanks for the link, but I've already read that and tried it out. Eveything works except for being able to install the gem with that method. I get something about extconf.rb failed.

@Fernando

I've tried to use mini_magick as well. My application loads just fine using that gem, but it will not process my image. It won't convert it to a thumb. The form reports an error saying Avatar failed to be processed.

The weird thing is I have all of this working on an older windows XP pc. But I just can't get it to work on this vista pc.

Thanks.

I tried switching to paperclip. But when I try to upload using paperclip its telling me the image isn't recognized by the identify command. But yet I can use identify in the command line. I'm completely stumped.

The path may not be correct inside your Paperclip converter. You may have it in your path, but inside Paperclip, it needs to know a root-relative path to the binary. I am pretty sure I have seen a configuration property for this, so check through all the Paperclip setup stuff. I ended up having to put this in my environment files, because what worked on my laptop didn't work at all on Slicehost.

Walter

Yeah, I never work with rails on windows, but I often hear that got some problems.

sure that you have the Imagemagick installed on Windows Vista and XP?

The RMAgick need to have the Imagemagick Installed to process images.

I thought I would update this for anyone who finds it in a search and needs help getting this working.

I believe my problem stemmed from using Pik and having two versions of Ruby installed. I'm not entirely sure about this but after removing it everything worked after I reinstalled it all. Here was the process for Windows Vista running Ruby192.

1. I first uninstalled everything. I uninstalled all versions of ruby/ gems, pik, and devkit. Restarted my PC.

2. I installed this version of Imagemagick into C:\ImageMagick-6.6.7-9- Q16, I checked every option during the install except for telling it to associate this program for file types or whatever:

http://image_magick.veidrodis.com/image_magick/binaries/ImageMagick-6.6.7-9-Q16-windows-dll.exe

3. Inside of c:\ImageMagick-6.6.7-Q16\config I deleted the type- ghostscript.xml file and replaced it with a windows version which I downloaded at:

http://www.imagemagick.org/source/type-windows.xml

And I put that inside of c:\ImageMagick-6.6.7-Q16\config.

4. Next I downloaded and installed Devkit:

https://github.com/oneclick/rubyinstaller/downloads/

5. Then I installed the rmagick gem from the cmd command line I ran:

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

This installed the gem just fine. If it doesn't try closing and reopening your command prompt.

6. I also called the rmagick gem from my gemfile:

gem 'carrierwave' gem 'rmagick'

Some other problems I ran into was sqlite3 not working properly you might need to download and extract both of these files into your ruby191/bin folder:

http://www.sqlite.org/download.html

I also had a problem with rake afterwards which I needed to update in the command line:

gem install rake

Then everything worked fine.