Display images stored on Amazon S3 using Heroku

I am trying to upload images and then display them in my application

I am setting up an application on Heroku to upload files to Amazon S3. I can upload images to S3. I see it on the Amazon. However, I cannot display it.

I used the code:

<%= image_tag user.profile_image.avatar.url, :size => "80x80" %>

It generates the following HTML (changes img to imgtag, since stackoverflow doesn't allow me to add this code):

<imgtag alt="Bob_dylanplanetwaves" height="80" src="http://appname-heroku/uploads/profile_image/avatar/1/bob_dylanplanetwaves.jpg"; width="80" />

http: //appname-heroku/uploads/profile_image/avatar/1/bob_dylanplanetwaves.jpg doe does not indicate any valid image.

I tried the following without success:

<%= image_tag user.profile_image.avatar.current_path, :size => "80x80" %>. 

he generated this code:

<imgtag alt="Album-the-bootleg-series-vol-4-bob-dylan-live-1966-the-royal-albert-hall-concert" height="80" src="/images/uploads/profile_image/avatar/2/album-the-bootleg-series-vol-4-bob-dylan-live-1966-the-royal-albert-hall-concert.jpg" width="80" /> 

In both cases, images are not displayed.

I use CarrierWave to update Ruby 1.9.2, Rails 3.0.3 and hosting in Heroku

+3
1

URL:

src="http://s3.amazonaws.com/heroku_appname/amazon_bucket_name/pictures/large/20.jpg"

appname: , heroku. amazon_bucket_name: bucked, AS3.

+1

All Articles