与Heroku建立与/ Amazon s3的连接

时间:2010-06-16 16:08:31

标签: ruby-on-rails ruby hosting amazon-s3 heroku

我正在尝试在Heroku上部署我的第一个应用程序,并且在使用S3连接时遇到一些麻烦。

以下是我从Heroku日志中获得的错误:

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

我配置了以下内容:

配置/ 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: <####>

项目模型

 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

1 个答案:

答案 0 :(得分:6)

配置为:bucket,not:bucket_name

http://docs.heroku.com/s3