Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Requests to public files are being sent through the router in production env

#5335

When running projects in production environment (rails server -e production) all requests to files in the public folder (robots.txt, CSS files, Javascripts, etc.) are for some reason being sent through the Rails router, instead of being served directly. This causes the following error message in the log:

ActionController::RoutingError (No route matches "/any_file_in_public_folder.xxx"):

When starting up the server in development mode, there is no problem.


System information:

Operating system: Mac OS X 10.6.4 Snow Leopard
Ruby version: 1.8.7
Rails version: 3.0.0.rc

Reported by Michael Henriksen · August 8th, 2010 @ 01:53 PM

State: invalid
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Chris Mear
    Chris Mear
    • Tag changed from 3.0.0.0rc, actioncontroller, routing to 3.0.0.0rc, actioncontroller, invalid, routing

    Rails 3 has a new default config option in production:

    config.serve_static_assets = false

    which would cause the error you're seeing. (Normally in actual production you'd have a front-facing web server like Apache, which would handle the request for static files before it reached the Rails router, so you wouldn't get this error). So, I think this is intentional.

    August 8th, 2010 @ 02:25 PM

  2. Michael Henriksen
    Michael Henriksen

    Ah okay, sorry for that!

    Thanks for your help :)

    August 8th, 2010 @ 03:00 PM

  3. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to invalid
    • Importance changed from to Low

    August 9th, 2010 @ 11:57 AM