I am getting the following error when trying to upload an image using paperclip and s3 storage. The app worked fine uploading locally, but when I've made the required changes to use s3 I get the following:
NameError in ImagesController#create
uninitialized constant AWS::S3::Base
Gemfile
source 'http://rubygems.org'
gem 'rails', '3.1.3'
gem 'sqlite3'
group :assets do
gem 'sass-rails', '~> 3.1.5'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
gem 'dynamic_form'
end
gem 'aws-sdk'
gem 'paperclip'
models/Image.rb
class Image < ActiveRecord::Base
has_attached_file :file,
:styles => {
:featured => "970x560>",
:thumb => "192x112>"
},
:storage => :s3,
:s3_credentials => "#{Rails.root}/config/amazon_s3.yml"
end
config/amazon_s3.yml
bucket: myapp-dev
access_key_id: ####################
secret_access_key: ################################
Bundled gems: aws-sdk (1.2.5) paperclip (2.4.5) rails (3.1.3)
include AWS::S3
somewhere. – Robin