-1

I have a model named VehiclePhotos and it has attachment field 'photo'. I used paperclip gem for uploading photos. Uploading was fine without any error. but when I tried to download the image, it gives

'500 Internal Server Error'.

log does not shows any error details.

vehicle_photos.rb

class VehiclePhotos < ActiveRecord::Base
  has_attached_file :photo,
                    :url => "/uploads/:class/:id/:attachment/:attachment_fullname?:timestamp",
                    :path => "uploads/:class/:attachment/:id_partition/:style/:basename.:extension"
end

in view, given following code to download

<%= link_to @object.photo_file_name , @object.photo.url %>

The file which contains uploaded photos has name 'vehicle_photos' and it has permission 777.

jithya
  • 428
  • 4
  • 13
  • add some more error code, to find the cause of the error. – Sravan Jul 27 '16 at 06:35
  • in browser it shows 'sorry, something went wrong' and in network tab shows '500 Internal Server Error' . only this much is showing.. – jithya Jul 27 '16 at 06:40

1 Answers1

0

"sorry, something went wrong" message usually does not show up in development environment. Instead, you would see a detailed error message with backtrace etc. So maybe you're running in production env? Then your error would go to production.log - check there. You couldn't guess the cause of error without the error details

pokrovskyy
  • 437
  • 5
  • 8
  • in production log also not showing any error details.. so I dont have any idea of debugging this error.. – jithya Jul 27 '16 at 07:25
  • if you're running your app via passenger on nginx or apache as a proxy, check their logs too, passenger could log some critical errors there, so they wouldn't arrive in local app logs at all – pokrovskyy Jul 28 '16 at 08:01