我在OpenShift上部署 Rails 应用程序时遇到了类似的问题。
在我的情况下,错误是由缺少资产产生的,未在清单文件中定义。
事实证明,它必须与assets做一些事情。我开始挖掘它,我发现它是在 Rails 找不到您正在寻找的资产时生成的,因为它们要么丢失,要么未编译,要么未包含在清单中(直接通过名称或间接通过要求树)。
第一种情况很清楚。您应该将它们包含在您的应用程序代码中,或者您应该将它们添加到您的设备中。第二种情况对您来说应该不是问题,因为 OpenShift 会为您做到这一点。但是,如果您确实对此有疑问,请在论坛中搜索有关不编译资产的问题。
The third case has two solutions. There is a right one and quick one. I'll need an expert's opinion about the second one. Here they are: You need to add the asset (usually a stylesheet and/or some third-party tool) to the list of items to precompile in the environment application.rb.
config.assets.precompile += ['960sm.css']
Or the quick way I found, which will work universally for all your assets:
There is a setting in the config/environments/production.rb
config.assets.compile = true
Set it to true like that and this should solve the problem.
I hope this helps. I spent two weeks digging on the same problem.