janko / uppy-s3_multipart

Provides Ruby endpoints for AWS S3 multipart uploads in Uppy
https://uppy.io/docs/aws-s3/
MIT License
65 stars 21 forks source link

error on trying to include in routing: undefined method bucket #2

Closed jrochkind closed 5 years ago

jrochkind commented 5 years ago

Trying to include in my Rails app. uppy-s3_multipart-0.1.0

Per instructions, include mount Shrine.uppy_s3_multipart(:cache) => "/s3" in my rails routes.rb.

Get:

     2: from /Users/jrochkind/code/scihist_digicoll/config/routes.rb:10:in `block in <main>'
     1: from /Users/jrochkind/.gem/ruby/2.5.3/gems/uppy-s3_multipart-0.1.0/lib/shrine/plugins/uppy_s3_multipart.rb:17:in `uppy_s3_multipart'
/Users/jrochkind/.gem/ruby/2.5.3/gems/shrine-2.13.0/lib/shrine/storage/file_system.rb:220:in `method_missing': undefined method `bucket' for #<Shrine::Storage::FileSystem:0x00007fe199c28e18> (NoMethodError)
jrochkind commented 5 years ago

Crap, hit the wrong button, didn't mean to file this yet. Will close.

Actual thing is "Could be a better more clear error if you accidentally try to use uppy_s3_multipart on a storage that isn't actually S3".

janko commented 5 years ago

Thanks for reporting, added the explicit error message and released 0.1.1. https://github.com/janko-m/uppy-s3_multipart/blob/3c97c5e49d8298bebae55cb6dd0b87082b08ed46/lib/shrine/plugins/uppy_s3_multipart.rb#L14-L16

jrochkind commented 5 years ago

Thanks! Once my app using this is in production, I'm gonna call for making it a 1.0.0 release. :)