Reputation: 231
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... :)
Upvotes: 0
Views: 1093
Reputation: 5724
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 )
Upvotes: 0
Reputation: 18736
You should precompile the assets before deploying the project.
bundle exec rake assets:precompile
Upvotes: 4