rails application doesn't load css/js/images i

2020-07-22 09:19发布

when i run my rails application in production mode images are not displayed and css is not working in my console i got the message ActionController::RoutingError (No route matches "/stylesheets/theme.css"): Rendered C:/Ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.0ms) but in my view/layout application.html.erb i included the line <%= stylesheet_link_tag 'theme' %> and theme.css is present in the public/stylesheet folder

1条回答
够拽才男人
2楼-- · 2020-07-22 10:04

make the following change in config/production.rb

change:

config.serve_static_assets = false

to:

config.serve_static_assets = true

That will fix it, I guarantee

查看更多
登录 后发表回答