gpt4 book ai didi

ruby-on-rails - 弃用警告 : [paperclip] [deprecation] AWS SDK v1 has been deprecated in paperclip 5

转载 作者:行者123 更新时间:2023-12-01 13:43:06 24 4
gpt4 key购买 nike

最近我将我的 Rails 版本从 3.2 迁移到 4.2.6,同时我修改了一些 gem,例如回形针 2.3 到 4.3.6。当我运行 rails server 时,我得到以下弃用:

DEPRECATION WARNING: [paperclip] [deprecation] AWS SDK v1 has been deprecated in paperclip 5. Please consider upgrading to AWS 2 before upgrading paperclip. (called from at /home/myuser/Desktop/project/app/models/user.rb:58) DEPRECATION WARNING: [paperclip] [deprecation] AWS SDK v1 has been deprecated in paperclip 5. Please consider upgrading to AWS 2 before upgrading paperclip. (called from at /home/myuser/Desktop/project/app/models/user.rb:72)

这是 user.rb,第 58 行:

  has_attached_file :photo,
:styles => { :small => "125x125>" } ,
:storage => :s3,
:s3_credentials => "#{Rails.root.to_s}/config/s3.yml",
:path => "/:style/:id/:filename"

这是 user.rb,第 72 行:

  has_attached_file :logo,
:styles => { :small => "200x100>" } ,
:storage => :s3,
:s3_credentials => "#{Rails.root.to_s}/config/s3.yml",
:path => "/:style/:id/:filename"

如何克服这种弃用?请帮忙

最佳答案

如果您没有在应用程序的其他任何地方使用 AWS gem,那么它会非常简单。升级 AWS gem,并通过 notes that Paperclip has provided确保升级顺利进行。

如果您在其他地方使用 AWS gem,那么您可以手动升级使用,或者您实际上可以在您的应用程序中同时拥有 gem 的 v1 和 v2。该 gem 提供有关 running them side-by-side 的信息.

关于ruby-on-rails - 弃用警告 : [paperclip] [deprecation] AWS SDK v1 has been deprecated in paperclip 5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38279440/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com