【问题标题】:Establishing connection w/ Amazon s3 from Heroku从 Heroku 建立与/Amazon s3 的连接
【发布时间】:2011-03-04 13:30:43
【问题描述】:

我正在尝试在 Heroku 上部署我的第一个应用程序,但在使 S3 连接正常工作时遇到了一些问题。

这是我从 Heroku 日志中得到的错误:

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

我有以下配置:

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: <####>

项目模型

 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

【问题讨论】:

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


    【解决方案1】:

    配置是 :bucket,而不是 :bucket_name

    http://docs.heroku.com/s3

    【讨论】:

    • 做到了。我在那里使用附件 fu 的代码。没有意识到细微的差异,也没有在文档中引起注意。谢谢。
    猜你喜欢
    • 2017-01-26
    • 1970-01-01
    • 2018-12-19
    • 1970-01-01
    • 2011-04-15
    • 2012-05-27
    • 2019-03-08
    • 2021-11-18
    • 2011-03-27
    相关资源
    最近更新 更多