Rails App Not Serving Assets in Production Environment

前端 未结 8 1969
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-01 01:29

My app works fine when run in development environment. In production (rails server -e production), the browser can\'t access the css and js files and on the con

8条回答
  •  醉梦人生
    2020-12-01 01:52

    The following command works for me locally.

    rails server -e production
    

    I got the same error "ActionController::RoutingError (No route matches [GET] "/assets/application.css"" while running "rails s". Even after I precompiled the source, change config precompile true. It still could not load properly.

    The option "-e production" made those RoutingError disappear.

提交回复
热议问题