处理 Rails 3.1 Assets 管道的第一天就失败了!
这是生产机器上的 asset:precompile 抛出的一长串错误中的最新一个:
“asset_path”的参数数量错误(1 对 2)
这发生在 application.css 文件上(我认为这是它尝试的第一个文件)。
这是我的 application.css 的内容
/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*= require_tree .
*/
.account-badge
{
background-color: #B94A48 !important
}
.centered {
float: none;
margin-left: auto;
margin-right: auto;
}
.container[role="main"] {
padding-bottom: 300px;
}
.page-footer {
border-top: 1px solid #EEEEEE;
padding-top: 17px;
}
可能需要提及的是我正在使用 twitter-bootstrap-rails在全新的应用程序中(未升级)
最佳答案
查看您的 bootstrap_and_overrides.css.less
文件,该文件由 application.css
的链轮 (*= require_tree
) 包含> 文件。
我猜错误是通过包含 @iconSpritePath
或 @iconWhiteSpritePath
来定位的。
编辑: 该方法需要两个参数:
asset-url("rails.png", image) # becomes url(/assets/rails.png)
asset-path("rails.png", image) # becomes "/assets/rails.png"
希望有帮助
关于ruby-on-rails-3.1 - Rails 3.1 Assets 管道预编译因 asset_path 参数错误而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10404977/