Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 74325

Rails: image exists but is not rendered in production even though rendered in development

$
0
0

There are similar questions like this, this, this, and this, but they don't address the problem.

We have a locally stored image that is rendered in the development environment.

In production, however, the image doesn't render. Accessing the image URL from the browser gets redirected to the 404 page because the image isn't found for some reason. Other images in the same directory are rendered without issue.

Details :-

  • Image 1 URL: https://test.com/designs/thumbnails/foo/bar1.jpg

  • Image 2 URL: https://test.com/designs/thumbnails/foo/bar2.jpg

  • Entering both image URLs directly into the browser yields different results. Image 1 will render, but image 2 won't. Image 2 redirects to the 404 page.

  • This isn't a caching issue, rendering in incognito fails.

  • Both images exist in the directory.

  • This seems to occur for new images, though the pattern isn't clear (i.e., some new images render but not all do).

  • Image rendering code: <img class="thumbnail" src="<%= design["thumbnailURL"] %>"> where design["thumbnailURL"] is an relative URL to the image (which, yes, does exist).

  • We use Rails 3.2 and Cloudflare.


Viewing all articles
Browse latest Browse all 74325


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>