[HELP PLEASE!] attachment_fu and aws-s3

38 views
Skip to first unread message

pat lacambacal

unread,
Jun 27, 2013, 10:50:39 PM6/27/13
to rubyonra...@googlegroups.com
Hi,

Im developing an image upload using pothoven-attachment_fu (3.2.8)
and aws-s3 (0.6.3). I want to store my files in Amazon S3.
I follow all the instructions using attachment_fu and s3

my model
has_attachment :content_type => :image,
:storage => :s3,
:max_size => 1.megabyte,
:thumbnails => {
:thumb => '145x145>',
:normal => '480x360>'
}

validates_as_attachment

amazon_s3.yml
development:
bucket_name: 'mybucket'
access_key_id: 'my_access_key'
secret_access_key: 'my_secret_key'

test:
bucket_name:
access_key_id:
secret_access_key:

production:
bucket_name:
access_key_id:
secret_access_key:

Im getting this error:

AWS::S3::PermanentRedirect in PhotoController#create

The bucket you are attempting to access must be addressed using the
specified endpoint. Please send all future requests to this endpoint.

Rails.root: /home/patrick/my_project
Application Trace | Framework Trace | Full Trace

app/controllers/photo_controller.rb:12:in `create'

Can anyone help me with?

Thanks!
Patrick

--
Posted via http://www.ruby-forum.com/.

Frederick Cheung

unread,
Jun 28, 2013, 6:10:02 AM6/28/13
to rubyonra...@googlegroups.com


On Friday, June 28, 2013 3:50:39 AM UTC+1, Ruby-Forum.com User wrote:

Im getting this error:

AWS::S3::PermanentRedirect in PhotoController#create

The bucket you are attempting to access must be addressed using the
specified endpoint. Please send all future requests to this endpoint.


Amazon is telling you to correct to the endpoint for your region /bucket ( looks like bucketname.s3-eu-west-1.amazonaws.com for a bucket in eu-west-1)
It looks  like with the s3 gem you are using you need to figure out that host and pass it as the :server option

Fred 
Reply all
Reply to author
Forward
0 new messages