2

I am running Rails 3.2.8 application in production mode. I have routing problems after i have done "rake assets:precompile".

My log message is :

ActionController::RoutingError (No route matches [GET] "/corp/assets/application-cf24b2a92e88a02835248f85a9f3c462.css"):

This file exists and it is in current location. My routes are under scope "corp".

My config "config/application.rb" have option "config.assets.enabled = true".

My config "config/environments/production.rb" have following options:

config.serve_static_assets = true
config.assets.compress = true
config.assets.compile = true
config.assets.digest = true

Application works fine in development mode. Before that assets:precompile everything was fine. After few hours of searching of posts i can't find any solution to my problem. Please help me fix this!

Dipak Panchal
  • 5,996
  • 4
  • 32
  • 68
Vesselin Yanev
  • 165
  • 2
  • 9

1 Answers1

6

In production mode, Rails will not be responsible for serving static assets. Therefore, you are getting this error. This is controlled by this setting in config/environment/production.rb in your application:

config.serve_static_assets = false

You can either set to that true or use a real server like Apache or Nginx which will serve the static assets. I suspect Pow may also do it.

Update

try this

  # Don't fallback to assets pipeline if a precompiled asset is missed
  config.assets.compile = true
  # Generate digests for assets URLs
  config.assets.digest = false
Dipak Panchal
  • 5,996
  • 4
  • 32
  • 68
  • It is already set as config.serve_static_assets = true and i am using apache with passenger, but stil have this routing error – Vesselin Yanev Nov 20 '12 at 10:49
  • 2
    config.assets.compile = true (doesn't this mean you aren't using the precompiled assets therefore missing on the performance benefits?) – henry74 Feb 07 '13 at 03:07
  • Down voted because no reference was given to the original author of the answer: http://stackoverflow.com/questions/7829480/no-route-matches-get-assets....On second thought, I'm not so sure thats a good reason to downvote but there you go... – iNulty Mar 25 '14 at 17:32