-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Incorrect AWS Path URL in Paperchip 5 #2237
Comments
I am/was having that same issue. Apparently there is a config variable available now called :s3_host_name and you set it to... :s3_host_name => 's3-us-west-2.amazonaws.com', Have never had to do this before but could be a change made from the past couple years. I never had to set the region before either. I found this solution here: http://stackoverflow.com/questions/16149815/ruby-on-rails-4-paperclip-aws-image-url-is-wrong |
That is with version 4. V4 works with that var. I'm pretty sure I've tried that. Are you using v5 and what gem version for aws? |
remote: Using aws-sdk 2.3.19 |
Ha. Maybe the aws gem was updated. I'll try the version you have later |
ya i just tried this and it worked for me. i did have to restart my anvil app to make it work. so try restarting server after making change. |
Having a similar issue. Paperclip uses the correct AWS host name when i specify it but then it includes the bucket name again on the url Paperclip provides this: http://MY-BUCKET.s3.amazonaws.com/MY-BUCKET/photos/images/000/000/001/original/img-1.jpg?1469480304 Instead of this: http://MY-BUCKET.s3.amazonaws.com/photos/images/000/000/001/original/img-1.jpg?1469480304 This is my paperclip config: config.paperclip_defaults = {
:storage => :s3,
:s3_region => ENV['AWS_REGION'],
:s3_host_name => "ENV['S3_HOST_NAME']",
:s3_credentials => {
:bucket => ENV['S3_BUCKET_NAME'],
:access_key_id => ENV['AWS_ACCESS_KEY_ID'],
:secret_access_key => ENV['AWS_SECRET_ACCESS_KEY']
}
} |
Any progress on this issue? I'm having essentially the same problem. I have the following configuration:
I'd expect this to produce a url structure like so:
Instead it looks like:
When I try to upload a file, I get the following error now:
I'm using |
I have been having the same issue with I resolved by setting my defaults as:
with The key difference was putting the url & path as shown. Perhaps this will work for you |
@charlesbedrosian I matched your setup exactly but it made no difference. I'm still stuck on the same error even after restarting the server. Here's my setup:
|
I solve my problem. According to the docs they renamed the |
thanks bro, you setup worked for me @danielbonnell been fighting this the entire day |
Still a bit new to Ruby stuff, but it wasn't obvious to me that setting the Region wouldn't automatically change the host name. I set it manually (storing things in West, not East) and it works fine. Possibly related documentation clarity: #2379 |
I'm on v5 and the solution posted by progus-florian on s3_host_name worked for me, using |
FYI #2379 is merged! |
Gems:
environment rb:
Image uploads to aws but the paperclip url is incorrect
The text was updated successfully, but these errors were encountered: