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

Undefined method thrown during S3 integration #8893

Closed
mbalc opened this issue Jul 12, 2018 · 5 comments
Closed

Undefined method thrown during S3 integration #8893

mbalc opened this issue Jul 12, 2018 · 5 comments

Comments

@mbalc
Copy link

mbalc commented Jul 12, 2018

Hey, I'm trying to implement S3 integration with an app built on Spree, but I can't get it up running according to your guides. Even a newly-built app fails.

Steps to Reproduce

  1. Set up a new app according to Getting Started
  2. Follow Use S3 for storage guide:
    a. Append gem 'aws-sdk' to Gemfile
    b. Run bundle install
    c. Append attachment_config script from link to config/intializers/spree.rb
  3. Run bin/rails console (actually, most other services, including bin/rails server and bin/rails db:schema:load end up the same way)

Expected Behavior

The console should run fine

Actual Behavior

The app throws a NoMethodError during initialization:

/home/mbalc/.gem/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/dynamic_matchers.rb:22:in `method_missing': undefined method `has_one_attached' for #<Cl
ass:0x00005648e37a6070> (NoMethodError)

I add full error trace in gist linked below

Your Environment

Most no-brainer stuff I add in this gist; ask for any other things

PS

Probably related: StackOverflow issue

@VygovskySergey
Copy link
Contributor

Hello, @mbalc, thanks for your question, this documentation is working for paperclip attachment, and now we are in process of migration to ActiveStorage. So, right now you can use these docs http://edgeguides.rubyonrails.org/active_storage_overview.html#amazon-s3-service
As soon, as we update our documentation, I can send a link to this conversation

@mbalc
Copy link
Author

mbalc commented Aug 29, 2018

Following with the knowledge concluded in the link provided helped me to configure my integration with S3, thanks for the feedback

@mbalc mbalc closed this as completed Aug 29, 2018
@AhmedAliIbrahim
Copy link

@mbalc can you provide how did you did that ? i followed what's on the link but still no luck

@mbalc
Copy link
Author

mbalc commented Sep 25, 2018

Hey @AhmedAliIbrahim
I'm not sure what situation you're in; please provide some more info about what errors do you encounter, or are these the same as mine?

Here's a diff of a pull request of the project I work on that enabled the S3
https://gist.github.com/mbalc/4428361c985149fd3e5e7c6ac818d6f4

@mbalc
Copy link
Author

mbalc commented Sep 25, 2018

The only other relevant, but very important change that was made there was to setup credentials via rails credentials:edit

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

3 participants