Server unable to find public folder in rails 3 production environment

元气小坏坏 提交于 2019-12-20 09:14:37

问题


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.


回答1:


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

config.serve_static_assets = true




回答2:


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



来源:https://stackoverflow.com/questions/2786344/server-unable-to-find-public-folder-in-rails-3-production-environment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!