应用程序错误不断发生:
2014-11-26T06:45:10.349830+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/stylesheets/application.css"):
在我的application.html中,我有:
<%= stylesheet_link_tag "application" %>
在我的production.rb中,因为heroku未提供服务,并且应用程序应提供我拥有的静态资产:
config.serve_static_assets = true
config.assets.compile = true
在实时网站上,我有:
<link href="/assets/application-da7e0e08bb87fbae6f1225fa189fab8e.css" media="screen" rel="stylesheet" type="text/css" />
网址
mysite/assets/application-da7e0e08bb87fbae6f1225fa189fab8e.css
返回结果。
网址
mysite/assets/application.css
还返回结果。
一切正常,但是日志中有此错误消息,我无法理解原因。 谁要求/stylesheets/application.css以及为什么以及如何阻止此错误发生。
Rails是“ 3.2.16”
应该有两个问题:
1)添加% <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
>>
2)看起来您已经在git repo中添加了资产预编译文件。 理想情况下,它不应该存在,因为heroku可以在您每次推动时为您提供帮助。
要解决此问题,您必须执行此操作