-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
AWS Version 2 support - uninitialized constant Paperclip::Storage::S3::AWS #1764
Comments
In the meantime the readme should probably be changed from More information: |
How to switch to fog: config.upload_file_options = {
- storage: :s3,
- s3_credentials: {
- bucket: ENV['FOG_DIRECTORY'],
- access_key_id: ENV['AWS_ACCESS_KEY_ID'],
- secret_access_key: ENV['AWS_SECRET_ACCESS_KEY']
+ storage: :fog,
+ fog_credentials: {
+ aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
+ aws_secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
+ provider: ENV['FOG_PROVIDER'],
+ region: ENV['FOG_REGION'],
+ scheme: 'https'
},
- s3_headers: {
+ fog_directory: ENV['FOG_DIRECTORY'],
+ fog_file: {
'Cache-Control' => 'max-age=315576000',
'Expires' => 10.years.from_now.httpdate
},
- url: ':s3_alias_url',
- s3_host_alias: '/',
path: 'files/:hash_:style.:extension',
hash_secret: ENV['SECRET_KEY_BASE']
} |
Hmmm but that is just changing the implementation for the Fog one. What is the recommended approach? I would have thought that using the official amazon SDK would be better. If not then is paperclip looking to drop direct support for s3? |
+1 for v2 aws-sdk support. A lot of work has gone into this release. |
👍 for aws-sdk v2 |
👍 |
👍 for aws-sdk v2 |
👍 |
4 similar comments
👍 |
👍 |
👍 |
👍 |
👍 |
1 similar comment
+1 |
What do the project maintainers intend to do or recommend doing?. I don't On Mon, Mar 16, 2015 at 11:23 AM, Daniel Drzimotta <notifications@github.com
|
👍 |
7 similar comments
👍 |
👍 |
👍 |
👍 |
👍 |
👍 |
👍 |
What on earth is going on here? |
👍 |
Can you detect which gem version is present and then just change the implementation accordingly? |
It's great to have everyone 👍 -ing, but would anyone want to submit a PR too for v2 support? |
@davetchen Did you mean you are able to use both v1 and v2 of the SDK in a project using Paperclip? I have a project using Paperclip and I'd like to use the v2 SDK for other purposes, but when I use the method you described to require both versions, Paperclip fails to generate a correct presigned POST when I do my uploads. I'm seeing the following error from S3
Any ideas? Is aws_v2 branch considered okay for production? I don't care what version Paperclip uses, I just want to be using v2 in the same project. |
It is working for me in a project with both aws-sdk-v1 and aws-sdk-v2, but haven't tested all use cases. If you're using the version from |
Region is US-Standard. As far as I can tell, the only thing that doesn't work is generating presigned POST params with Paperclip. Maybe I can just rewrite my code to sign it with the SDK v2 directly. But I still need to test other important stuff such as |
My development environment was set up incorrectly and the problem was unrelated to Paperclip. Everything works now with both versions, sorry for the false alarm. :) |
Sounds good @xtagon! Did you end up trying the aws_v2 branch? |
Haven't gotten around to it yet since v1 and v2 work fine side by side. I'll test it when I get a chance and report any issue if I find any. |
@betesh : I've been using the aws_v2 branch in production for a couple weeks with no issues. Do you think it's ready for a PR? |
@davetchen The problem is not all the tests pass. I just pushed a commit (after rebasing onto master) with one example of getting a few tests to pass when stubbing, but there's still a lot of work to be done on this end. |
Understood, I'll take a look at your commit. |
@betesh I'm trying to setup the testing as described here: https://github.com/thoughtbot/paperclip/blob/master/CONTRIBUTING.md The 'bundle' command has been running for the last 3 hours ... do you have an easier way to set it up? To see what is going on I set it's still 'iterating'... |
I just did a bundle update and it took a few minutes but nothing crazy. I don't recall this happening during the first bundle install either. I didn't to an appraisal install--I figured once tests are passing with 1 Gemfile, I'll open up my branch to travis to get a first approximation of any issues, before trying to debug all Gemfiles locally. |
I think the problem is trying to find the right version of the 'rubysl' gem. I'm using ruby-1.9.3 and trying to install
There is a conflict with 'rubysl-benchmark' which has a dependency on ruby-2. Which ruby are you using? |
I'm using ruby-2.1.5 |
OK -- just switched to ruby-2.1.6 and now I can run the tests (that was easy). I'm seeing 40 or so failures in the S3 storage spec of the form:
Will start looking at these. |
Hi Betesh -- just wondering about the status of the pull request. Are there other actions that need to be taken? |
Not in my opinion. In my last 2 comments on #1903 (#1903 (comment), #1903 (comment)), I asked for feedback on the 2 issues people were still discussing, but I have received no feedback. I just rebased it onto upstream/master. Give Travis an hour or 2 and then if everything passes, I'm ready for it to be merged. |
Is anyone planning on merging this? |
@davetchen @betesh sorry for the delay here. We're running a little behind right now because of vacations, our company retreat, and some other distractions. We're not sure when we'll be able to look at this, but we haven't forgotten about Paperclip and we'll get it merged as soon as we can. |
Thanks for the update. Moving forwards more and more folks will be wanting to standardize on using the aws-sdk-v2, both for accessing new regions and new services. |
👍 |
any plans to have this merged? |
#1903 was merged just about 2 weeks ago. |
It appears that the latest version of AWS - version 2, is not compatible with paperclip. From the aws-sdk-ruby:
Is there a plan to do the upgrade?
The text was updated successfully, but these errors were encountered: