Note that there are some explanatory texts on larger screens.

plurals
  1. PORails production static files routing error
    primarykey
    data
    text
    <p>When I run my app locally in test/dev my views come up nicely and everything is happy. When I try to navigate to those same erb files running on my remote server/local production server I get errors like the following:</p> <pre><code>ActionController::RoutingError (No route matches "/stylesheets/scaffold.css") </code></pre> <p>I've seen similar questions here on SO but none have been able to solve my problem. The closest thing I've found to an answer is the first answer here: <a href="https://stackoverflow.com/questions/3410956/rails-404-error-for-stylesheet-or-javascript-files">Rails 404 error for Stylesheet or JavaScript files</a></p> <p>As I understand it the best thing to do would be to configure my webserver to serve static files. How do I do this locally/on Heroku?</p> <p><strong>Update</strong></p> <p>As per raidfive's suggestion I changed config.serve_static_assets from false to true and this fixed my issue. However, I see that it says in production.rb that Apache or nginx should already be serving static assets. Is it any less good/professional to serve static assets in this way and if so how would I achieve the desired results if I'm using Heroku?</p> <p><strong>Update 2</strong></p> <p>Apparently Heroku <a href="http://docs.heroku.com/rails3#serving-static-assets" rel="nofollow noreferrer">does this automatically</a>, I had an extra comma that was causing the mischief. I was able to look in the extended Heroku logs using the <a href="https://stackoverflow.com/questions/2671454/heroku-how-to-see-all-the-logs/2672296#2672296">following tip</a> to track down the trouble. Thanks SO!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload