(solution) .js and .css error when using production environment

When changing to a production deployment with a single rails instance,
NOT proxied, errors showed up on the console, and of course .js and .css
files were not served as a result:

ActionController::RoutingError (No route matches
“/javascripts/application.js”):

ActionController::RoutingError (No route matches “/favicon.ico”):

Solution:
in config/environments/production.rb:

Disable Rails’s static asset server

In production, Apache or nginx will already do this

config.serve_static_assets = false

The key is to comment the third line.

I know: using Mongrel for production isn’t recommended, to say the
least. I’m just posting the info so if you try it, you’ll know why it’s
behaving differently.

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