NameError (uninitialized constant Paperclip::Storage::S3::AWS):

前端 未结 4 726
情歌与酒
情歌与酒 2020-12-02 21:31

I\'m trying to incorporate images into my web app and I keep running into this error after removing quite a few features. It came down to my \'create\' application controlle

4条回答
  •  春和景丽
    2020-12-02 22:09

    Paperclip use to use AWS-SDK v1 in versions 4.3 and bellow. They are trying to include the AWS-SDK v2

    official upgrade document https://github.com/thoughtbot/paperclip/blob/master/UPGRADING

    ##################################################
    #  NOTE FOR UPGRADING FROM 4.3.0 OR EARLIER       #
    ##################################################
    
    Paperclip is now compatible with aws-sdk >= 2.0.0.
    
    If you are using S3 storage, aws-sdk >= 2.0.0 requires you to make a few small
    changes:
    
    * You must set the `s3_region`
    * If you are explicitly setting permissions anywhere, such as in an initializer,
      note that the format of the permissions changed from using an underscore to
      using a hyphen. For example, `:public_read` needs to be changed to
      `public-read`.
    

    due to some backwards incomparability (read this https://github.com/thoughtbot/paperclip/issues/2021) this is merged but officially not released yet, but should be released in Paperclip v 5.0.0

    So like Vitali Mogilevsky mentioned, you have to use this for now:

    # Gemfile
    # ...
    gem 'paperclip', :git=> 'https://github.com/thoughtbot/paperclip', :ref => '523bd46c768226893f23889079a7aa9c73b57d68'
    

    When Paperclip 5.0 is released, AWS-SDK v2 should be included

提交回复
热议问题