首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Spree-blogging-spree missing必填项:bucket选项

Spree-blogging-spree missing必填项:bucket选项
EN

Stack Overflow用户
提问于 2017-03-31 05:29:30
回答 1查看 82关注 0票数 0

我在一个狂欢商店工作,亚马逊s3在主应用程序上工作得很好。我只是按照read的说明添加了spree-blogging-spree gem,但是当我尝试编辑帖子或添加图片时,我得到了一个missing required :bucket option错误。这只适用于与博客相关的编辑和图片,其他一切都运行良好。

我知道这是指s3,但我不确定它为什么会出现在现在。有没有我错过的迁移或者我需要添加的配置文件?

代码语言:javascript
复制
Showing /usr/local/rvm/gems/ruby-2.3.0/bundler/gems/spree-blogging-spree-81da8dd081a5/app/views/spree/admin/blog_entries/_form.html.erb where line #85 raised:

missing required :bucket option
Extracted source (around line #242):
240
241
242
243
244
245

        @bucket = @options[:bucket] || s3_credentials[:bucket]
        @bucket = @bucket.call(self) if @bucket.respond_to?(:call)
        @bucket or raise ArgumentError, "missing required :bucket option"
      end

      def s3_interface

Trace of template inclusion: /usr/local/rvm/gems/ruby-2.3.0/bundler/gems/spree-blogging-spree-81da8dd081a5/app/views/spree/admin/blog_entries/edit.html.erb

Rails.root: /home/ubuntu/workspace/mumbles_spree
EN

回答 1

Stack Overflow用户

发布于 2017-04-02 05:06:16

我想我必须将我的s3凭证添加到blog_entry_image.rb中:

app/model/spree/blog_entry_image.rb

代码语言:javascript
复制
class Spree::BlogEntryImage < Spree::Image
  has_attached_file :attachment, 
     :styles => {:mini => '48x48#', :normal => '200x200>', :large => '600x600>'},
     :default_style => :large,
     :url => "/assets/blog_entry_images/:id/:style/:basename.:extension",
     :path => ":rails_root/public/assets/blog_entry_images/:id/:style/:basename.:extension" ,
      storage: :s3,
                  s3_credentials: {access_key_id: 'xxx', 
                  secret_access_key:  'xxx'},
                  bucket: 'xxx'
end
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43128703

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档