Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Server unable to find public folder in rails 3 production environment

I'm using the latest rails 3 beta. The app works fine in development mode, but when I start the server in production mode via rails server -e production, it seems that the public folder can't be found. I get error messages like:

ActionController::RoutingError (No route matches "/javascripts/jquery.js"):

And similar messages for everything that should be in the public folder. I've tried this with both mongrel and webrick. I'd appreciate any help.

like image 960
James Avatar asked May 07 '10 05:05

James


2 Answers

editing config/environments/production.rb and setting this line:

config.serve_static_assets = true

like image 112
d4ny1 Avatar answered Nov 20 '22 09:11

d4ny1


nginx, unicorn and apache will do this automatically. be sure to change this back to false if you are deploying using these servers.

like image 1
bonhoffer Avatar answered Nov 20 '22 10:11

bonhoffer