0
votes

Disclaimer: I have looked all over but there are too many solutions to the problem which did not work for me hence this post.

Developed a simple website using Rails 3.2.2 in development mode got all assets working fine. When I switched to use production (ie: rails server -e production), the assets breaks and I get the ActionController::RoutingError (No route matches [GET] "/stylesheets/application.css") error.

I haven't changed the production.rb file.

Thanks for helping this frustrated human being... :)

3

3 Answers

4
votes

You should precompile the assets before deploying the project.

bundle exec rake assets:precompile
0
votes

In production.rb try config.serve_static_assets = true

0
votes

I just had the same issue. I forgot to add my files to config.assets.precompile...

Rails assets working in development and not production

in my config/environments/production.rb I had to add a list of non default assets (like plugins)...

config.assets.precompile += w%( jquery.plugin.js awesome.css etc )