I’m working on implementing an Amazon S3 uploader for my rails project.
I’m trying to access a bucket so that I can assign all the images to a variable and list them.
I keep getting the following error when I try to view my new action in my uploads controller:
undefined method `find' for AWS::S3::Bucket:Class
Here is my uploads_controller.rb
class UploadsController < ApplicationController
require 'aws/s3'
def new
photo_bucket = AWS::S3::Bucket.find('photos')
@photos = photo_bucket.objects
end
end
The find method is documented here http://amazon.rubyforge.org/.
Any clue as to what is going on here?
Thanks.
Here is my Gemfile:
gem 'paperclip'
gem 'aws-s3'
gem 'aws-sdk'
gem 'rails', '3.2.0'
gem 'bcrypt-ruby', '3.0.1'
gem 'nokogiri'
gem 'kaminari'
gem 'acts-as-taggable-on', '~> 2.2.2'
gem 'omniauth-twitter'
gem 'omniauth-facebook'
gem "friendly_id", "~> 4.0.1"
You can’t use aws-s3 and aws-sdk together since they will conflict with each other.