Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing required :bucket option #19

Open
kristena11 opened this issue Mar 31, 2017 · 1 comment
Open

missing required :bucket option #19

kristena11 opened this issue Mar 31, 2017 · 1 comment

Comments

@kristena11
Copy link

I am getting an amazon s3 error when trying to add an image or edit a post. This is working fine everywhere else in my app, I can upload images and they save to s3. Is there a config file I need to add to get this extension to use s3?

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
@kristena11
Copy link
Author

kristena11 commented Apr 1, 2017

I figured it out I had to add my s3 credentials to the blog_entry_image.rb:

app/models/spree/blog_entry_image.rb

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant