Hot questions for Using Spree in paperclip


I'm trying to upload Spree images to S3. but I'm having trouble to do it.

I get this error:

   raise e
        if >= &&
          raise LoadError, "paperclip does not support aws-sdk versions 2.0.0 - 2.0.33.  Please upgrade aws-sdk to a newer version."

For my understood the aws version needs to be upper to 2.0.33, but as you can see, this is my gemfile

gem 'aws-sdk', '~> 3'

Also I don't have gem for paperclip. Need to add one?


Ok, "fixed it". It's a problem with paperclip and the latest version of aws.

There's two work around:


gem 'aws-sdk', '< 3.0'


# config/initializers/aws.rb
Aws::VERSION =  Gem.loaded_specs["aws-sdk"].version


I have Two Application.

  1. Spree Application
  2. Rails Application

I have configure 1 module.

That module have image upload functionality.

I have to upload image in another application which is Rails Application.

How can i configure two application each other ?

How can i upload image on another Rails application and get URL back to Spree Application and that URL store in Spree Application ?


I Found Answer.

This Answer for Two Application Hosted in Same Server.

First Application Which is in Spree. It have Image Model with attachment Field.

Change Code in "path" and "url" to upload image on another rails application which is hosted in same server.

For Example :

has_attached_file :attachment,

      styles: { mini: '48x48>', small: '100x100>', product: '240x240>', large: '600x600>' },

      default_style: :product,

           url: "#{MEDIASERVER_URL}/spree/products/:id/:style/:basename.:extension",

           path: "#{MEDIASERVER_PATH}/public/spree/products/:id/:style/:basename.:extension",

          convert_options: { all: '-strip -auto-orient -colorspace sRGB' }

MEDIASERVER_URL is a url to getting image from remotely. for example http://localhost:4000

MEDIASERVER_PATH is a path to store image in which location. It is a another rails application . for example /home/ServerName/ProjectName enter code here


There are similar questions around, but many are very old and none have an answer for this specific scenario: Paperclip automatically installed by Spree.

With Spree version 3.0.0, the output of gem list shows:

cocaine (0.5.7)
paperclip (4.2.4)

What needs to be fixed:

Paperclip::Errors::NotIdentifiedByImageMagickError in Spree::Admin::ImagesController#create

I'm hoping to find out that I need to downgrade the cocain version... No dice yet.


Turned out to be a problem with the images I was working with. I found out by trying to identify them in the command line.

identify poor-quality-image.png

It threw the same error.