Rails App Images fail to render with Apache2 Server


Rails app works fine using WEBrick, (localhost:3000) but when using
Apache2 (localhost:80), all images on page fail to render.

Apache2 error_log reports:
[error] [client] File does not exist:

Rails log/development.log does not report any error.

DocumentRoot “/srv/www/htdocs”

I am working through the DEPOT app in the Agile Web D. with
Rails book. If anyone has come across this ‘problem’ before, please


Where is your rails app ? IIRC you need to set DocumentRoot to the path
to your rails app + public, eg
DocumentRoot “/srv/www/my_rails_app/public”


The Apache config is correct as all the depot pages are working except
for the images – they are not displaying using Apache.

Thanks to a ‘Note About Links and Static Content’ on the wiki
“HowtoUseSymLinksToGraftRailsOntoYourWebsite”, after reading it I
switched to using using Rails’ ‘image_tag’ , instead of HTML '<img src=
… ’ as follows:
<%= image_tag product.image_url, :alt => “”, :size => “60x70” %>
instead of

The images are now displaying with WEBrick and Apache servers.


On Nov 23, 8:47 pm, Frederick C.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs