开发者

How to set path to public in Rails 2.2.3 Application

I am trying to get a local instance up of an existing rails application. It is built on Rails 2.2.3. I keep getting errors that seem to me like I need to set the path to the public directory. When I run "scripts/s开发者_如何学编程erver" and request pages, I get these errors:

ActionController::RoutingError (No route matches "/favicon.ico" with {:method=>:get}): ...

ActionController::RoutingError (No route matches "/stylesheets/cache/xxx.css" with {:method=>:get}):

ActionController::RoutingError (No route matches "/javascripts/cache/xxx.js" with {:method=>:get}):

How do I set the path to public? Could this have something to do with setting "RAILS_ROOT"?

Thanks


Check that in config/environments/{development,test,production}.rb, serve_static_assets is set to true. Otherwise, Rails will not serve the assets in /public.

Note that in production, you should likely have Apache or whatever web server you use serve those assets. Running it through Rails proper is an unnecessary slow down.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜