1
votes

I'm using rails and paperclip in uploading in AWS S3 bucket. The bucket name, secret keys, region are the same for both Heroku and AWS, in Heroku it's working fine i can see the image but in AWS its not working.

In AWS this is the path and its not working.

http://s3-ap-southeast-2.amazonaws.com/assets.steel-ps.com/var/www/steelip-admin/public/ckeditor_assets/pictures/45/content_notes-icon-mac.jpg

In Heroku its working fine

http://s3-ap-southeast-2.amazonaws.com/assets.steel-ps.com/app/public/ckeditor_assets/pictures/45/content_notes-icon-mac.jpg

Notice that in AWS its adding my '/var/www/steelip-admin' which is the folder in my server. What could be wrong.

Thanks.

2
Why you say the second link is Heroku as it is an AWS link ?Maxence
Can you include the code that you are using to generate the image tag? My first guess would be either the method you're using in your css, or you need to prepend http:// to the href of your image.DivXZero
sorry i haven't explain deeply I'm using ckeditor and in my route file I only have this line mount Ckeditor::Engine => '/ckeditor'Kruze

2 Answers

0
votes

Thanks for all the help everyone. Basically the fix were inside the CkEditor::Picture class. I have remove the rails_root in front of the path.

path: 'app/public/ckeditor_assets/pictures/:id/:style_:basename.:extension'
0
votes

I just came across this one, because I was dealing with the same issue. The fix I found was to add s3_host_name to the config.paperclip_defaults.

s3_host_name: 's3.eu-central-1.amazonaws.com',