Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Establishing connection w/ Amazon s3 from Heroku

I am attempting to deploy my first app on Heroku and having a little trouble getting the S3 connection to work.

Here is the error I am getting from the Heroku logs:

AWS::S3::CurrentBucketNotSpecified (No bucket name can be inferred from your current connection's address (`s3.amazonaws.com')):

I have the following configured:

config/s3.yml

development:
    bucket_name: dev.myapp.mycompany
    access_key_id: <####>
    secret_access_key: <####>

test:
    bucket_name: test.myapp.mycompany
    access_key_id: <####>
    secret_access_key: <####>

production:
    bucket_name: production.myapp.mycompany
    access_key_id: <####>
    secret_access_key: <####>

Project Model

 class Project < ActiveRecord::Base
        has_attached_file :preview,
        :storage => :s3, 
        :s3_credentials => "#{RAILS_ROOT}/config/s3.yml", 
        :path => "/:style/:filename",
        :styles => {
          :thumb => "72x44",
          :small => "312x192"
        }

        has_many :posts, :dependent => :destroy


end
like image 578
bgadoci Avatar asked Jun 16 '10 16:06

bgadoci


People also ask

What is S3 Heroku?

Amazon Simple Storage Service (S3) is a durable and available store, ideal for storing application content like media files, static assets, and user uploads. Storing static files elsewhere is crucial for Heroku apps since dynos have an ephemeral filesystem.

Can we use S3 as NFS?

AWS Storage Gateway now supports NFS file share auditing end-user access to files, folders, and file shares on Amazon S3 File Gateway.


1 Answers

The config is :bucket, not :bucket_name

http://docs.heroku.com/s3

like image 78
Ben Hughes Avatar answered Sep 19 '22 18:09

Ben Hughes