【发布时间】: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