1
votes

I am trying to upload files from the ckeditor gem in a rails 3.2.1 app using Carrierwave with MiniMagic.

I am on OSX 10.6

I used the generator that comes with the gem to generate the models and uploaders, i.e.

rails generate ckeditor:install --orm=active_record --backend=carrierwave

At the time I click the button to send an image file to the server, I am getting the following error (in the server output):

Errno::ENOENT (No such file or directory - identify -ping /var/folders/wK/wKG0M7udG5K7cAjGxTF86k+++TI/-Tmp-/mini_magick20120303-72546-1sg4xlv.jpeg):

It appears to be expecting the tmp file to be in that location, but it is putting them in public/uploads/tmp (the file is still there after this happens).

If I turn off MiniMagick (by commenting out the include in ckeditor_picture_uploader and removing the resizing code), I get a different error:

ArgumentError (Version content doesn't exist!): app/models/ckeditor/asset.rbin url' app/models/ckeditor/picture.rb:5:inurl_content'

In the latter case the file actually ends up in the public/uploads directory, but I am still not able to use it due to:

I also get the "Version content doesn't exist" error if I just open the image link dialog and press "Browse Server" (meaning I get the error as soon as I hit the button, not after I select a file, which I can't do because of the error).

I have not modified the asset.rb and picture.rb created by the generator.

Any help would be appreciated.

3
Does which identify actually results in the path to the identify command?Maran
Good question. I was fixated on the path being wrong but you're right it appears that the identify command does not exist. I would think if it is needed the mini_magick gem should have installed it(?). I have mini_magick in my Gemfile and the bundle output says "Using mini_magick (3.4)"Mark Fraser
You will still need to install ImageMagick to use it. MiniMagick is just a wrapper around the command line tools for IM.Maran
That's annoying. The reason I tried to go the carrierwave route (instead of paperclip) was that the paperclip docs said you need ImageMagick and the carrierwave docs did not. Thanks for your help. I think the "Version content doesn't exist" problem is separate but for clarity I will submit a separate issue if it persists after clearing up the ImageMagick problem (unless someone answers it in the meantime)Mark Fraser

3 Answers

1
votes

Check out the solution at the bottom of this link :

https://github.com/jnicklas/carrierwave/issues/345

My problem was fixed just by installing ImageMagick (as others have mentioned), but some say that adding :

ENV['PATH'] = "/usr/local/bin:#{ENV['PATH']}"

to the application.rb fixed the problem.

0
votes

As Maran has mentioned you need to install ImageMagick. In my opinion, Homebrew is by far the easiest way to install ImageMagick, I highly recommend it.

0
votes

I think you need to reinstall imagemagick.

Command to install

brew install imagemagick