1
votes

I'm building a Rails 3.1 app and I'm using S3 and paperclip in a for photo storage, but I keep getting the following error:

RuntimeError (Style thumb has no processors defined.):

Here are the pertinent lines from my Photo model:

has_attached_file :photo,
:default_style => :original,
:styles => {:thumb => "150x150>"},
:url => "uploads/photos/:id/photo.:extension",
:path => "uploads/photos/:id/photo.:extension",
:storage => :s3

Here is the code around line 49 in the photos controller:

@photo = current_user.photos.new
@photo.caption = params['Filename']
# first save so that we can render a row
@photo.save
@photo.photo = params['Filedata']

Thread.new do 
  # second save to upload the photo
  @photo.save
end

Any ideas as to what I'm doing wrong?

3
Do you have ImageMagick and the convert tool installed in a place that Paperclip can find it? - tadman
which convert -> /usr/local/bin/convert, and I have Paperclip.options[:command_path] = "/usr/local/bin/" in my development.rb environment file... - Chris Bisignani

3 Answers

0
votes

After reading the paperclip documentation on processors, it seems to me that the default processor (Paperclip::Thumbnail) does not get attached. You could try and add it manually with:

:processors => [:thumbnail]
0
votes

I figured out the problem. I was overriding the default settings class method for Paperclip in an initializer.

0
votes

For Mac OSX users:

installing homebrew and running

brew install imagemagick

did the trick for me.

PS. If the installation of imagemagick results in something like this:

Error: The linking step did not complete successfully The formula built, but is not symlinked into /usr/local

run:

sudo brew link imagemagick