【发布时间】:2012-11-24 18:32:48
【问题描述】:
我的 rails 应用程序目前拒绝在我的生产服务器(linode 服务器)上的 application.css 中获取 body 标签样式,但它可以在我的 localhost:3000 上运行。 我的资产管道如下所示
*= require bootstrap.min
*= require bootstrap_customization
*= require datepicker
*= require select2
*= require_self
*= require_tree .
我尝试过切换 require_self 和 require_tree 的位置,但它并没有改变任何东西。我想指出所有其他样式都被选中了,只是在 application.css 中没有被选中的 body 标签。这是body标签的代码
body{
background: transparent url('/assets/bg2.png');
font-family: 'Lucida Grande', Verdana, Helvetica, Arial;
}
我已尝试在 css 中添加类以更具体地对其范围进行调整,并且我已确保图像上没有允许访问它的权限。但它只显示一个白色背景,并使用此标签上方的 body 标签样式(具有背景图像的标签),但仅此而已。这仅在生产中发生,该背景图像在我的本地主机上完美显示,这很奇怪有人知道吗?
【问题讨论】:
-
如果你在生产中,你确定你以前不需要编译资产吗?
bundle exec rake assets:precompile等 -
我已经这样做了好几次了,我已经将我的生产环境设置为资产预编译 = true
标签: css ruby-on-rails background-image asset-pipeline production-environment