我正在尝试在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