Ruby on rails 回形针2.8未使用'config.Paperclip_defaults'散列

Ruby on rails 回形针2.8未使用'config.Paperclip_defaults'散列,ruby-on-rails,amazon-s3,paperclip,Ruby On Rails,Amazon S3,Paperclip,由于某些原因,我无法让回形针正确使用S3。我已经按照文档所述配置了它,但是我的所有环境仍然使用public/system目录来存储文件 以下是我的配置: # config/application.rb config.paperclip_defaults = { :default_url => "/assets/:attachment/default/:style.jpg", :storage => :s3, :s3_protocol => 'h

由于某些原因,我无法让回形针正确使用S3。我已经按照文档所述配置了它,但是我的所有环境仍然使用
public/system
目录来存储文件

以下是我的配置:

# config/application.rb

config.paperclip_defaults = {
  :default_url => "/assets/:attachment/default/:style.jpg",
  :storage => :s3,
  :s3_protocol => 'https',
  :s3_credentials => {
    :access_key_id =>  ENV['S3_KEY'],
    :secret_access_key =>  ENV['S3_SECRET']
  },
  :bucket =>  ENV['S3_BUCKET'],
  :path => "/:attachment/:id/:style.:extension",
  :styles => {
    :giant  => ["600x600>"],
    :huge  => ["450x450>"],
    :large  => ["300x300>"],
    :medium => ["200x200>"],
    :small => ["100x100>"],
    :thumb => ["48x48>"],
    :profile => ["34x34>"],
    :mini => ["24x24>"]
  }
}
我已确认在我的
应用程序中所有存储桶的命名都正确。yml
S3\u密钥
S3\u秘密
都是正确的

我使用的是
gem“回形针”、“~>2.8”
,因为这是一个较老的项目,我们现在还不担心更新

更新 我现在意识到,以前的一位开发人员将回形针版本从
~>3.1
更改为
~>2.8
,以便在移交项目之前解决一些依赖性问题。。。然而,在他把它交给我之前,它确实是正确的,他从来不知道它把配置搞砸了。版本2.8不像3.0那样设置全局默认值,因此
config.paperclip\u默认值在我的版本中显然毫无意义

相反,我更新了我的
application.rb
文件,以设置
Paperclip::Attachment.default\u选项的默认值

# config/application.rb

Paperclip::Attachment.default_options[:default_url]     = "/assets/:attachment/default/:style.jpg"
Paperclip::Attachment.default_options[:storage]         = :s3
Paperclip::Attachment.default_options[:s3_protocol]     = 'https'
Paperclip::Attachment.default_options[:s3_credentials]  = {
  :access_key_id =>  ENV['S3_KEY'],
  :secret_access_key =>  ENV['S3_SECRET']
}
Paperclip::Attachment.default_options[:bucket]          =  ENV['S3_BUCKET'],
Paperclip::Attachment.default_options[:path]            = "/:attachment/:id/:style.:extension",
Paperclip::Attachment.default_options[:styles]          => {
  :giant  => ["600x600>"],
  :huge  => ["450x450>"],
  :large  => ["300x300>"],
  :medium => ["200x200>"],
  :small => ["100x100>"],
  :thumb => ["48x48>"],
  :profile => ["34x34>"],
  :mini => ["24x24>"]
}

正如我在问题中提到的,
gem“paperclip”、“~>2.8”
不响应
config.paperclip\u默认值
散列,而是从
paperclip::Attachment.default\u选项
散列中获取默认值。

@user2954587我的日志中没有错误,只是我试图让paperclip将图像存储在我的S3存储桶中,但它仍在本地存储它们。