gpt4 book ai didi

ruby-on-rails-3.1 - file.png 未预编译

转载 作者:行者123 更新时间:2023-12-04 15:56:46 26 4
gpt4 key购买 nike

我以为我已经弄清楚了 Assets 管道,但现在没有了。

我有一个名为 clients.css.scss 的样式表

.client
{

.list_view
{
width: 650px;
height: 500px;
overflow: auto;

table
{
width: 650px;
border: solid 2px #999999;
border-collapse: collapse;

thead tr
{
background: image-url('list-view-header.png') repeat-x;
}

thead tr:first-child
{
background-image: none;
}
}
}
}

每次我尝试在生产中预编译它时,我都会收到“file.png 未预编译”错误。
bundle exec  rake assets:precompile RAILS_ENV=production --trace
/usr/local/rvm/gems/ruby-1.9.2-p290@pm/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/usr/local/rvm/gems/ruby-1.9.2-p290@pm/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_
rake aborted!
list-view-header.png isn't precompiled
(in /var/rails/pm.onlinetherapy.com/app/assets/stylesheets/clients.css.scss.erb)

Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

图像文件位于 app/assets/images 目录中,我可以在 public/assets 目录中看到它的扩展指纹名称。

任何想法都会有所帮助。

最佳答案

我相信你想要的是这样的:

thead tr
{
background: image-url('/assets/list-view-header.png') repeat-x;
}

或者您可以将您的 clients.css.scss 更改为 clients.css.scss.erb 并执行以下操作:
thead tr
{
background: image-url(<%= asset_path "list-view-header.png" %>) repeat-x;
}

关于ruby-on-rails-3.1 - file.png 未预编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8048164/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com