Richlewis
Richlewis

Reputation: 15374

Upload paperclip images to s3 bucket

Not quite sure whats going on here, but when i try and upload an image to my s3 bucket i get this error

 NameError in PostsController#create

 uninitialized constant AWS::Core::ClientLogging

 Rails.root: /home/richardlewis/Rails/myblog
 Application Trace | Framework Trace | Full Trace

 app/controllers/posts_controller.rb:41:in `create'

Im testing this in my dev environment at present. This is my current setup

Gemfile

#Paperclip and aws
gem "paperclip", "~> 3.0"
gem 'aws-sdk'
gem 'aws-s3'

Image Model

class Image < ActiveRecord::Base
belongs_to :imageable, polymorphic: true

attr_accessible :photo
has_attached_file :photo, :styles => { :small_blog => "250x250#", :large_blog => "680x224#", :thumb => "95x95#" },
 :storage => :s3,
 :url  => ":s3_domain_url",
 :s3_protocol => 'http',
 :path => "/images/:id/:style.:extension",
 :s3_credentials => {
 :bucket => ENV['AWS_BUCKET'],
 :access_key_id => ENV['AWS_ACCESS_KEY_ID'],
 :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY']
}
end

My ENV variables are stored in a env.rb file and loaded within initializers

has anyone come across this before?

Upvotes: 0

Views: 373

Answers (1)

Ryan Bigg
Ryan Bigg

Reputation: 107708

Upgrading to the latest paperclip, 3.5.1, will fix this issue.

Upvotes: 1

Related Questions