4

Rails 3.1 アセット パイプラインを扱う 1 日目と敗北!

以下は、実稼働マシンで assets:precompile によってスローされた一連のエラーの最新のものです。

wrong number of arguments (1 for 2) for 'asset_path'

これは、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を使用していることに言及することが重要かもしれません (アップグレードではありません)。

4

1 に答える 1

3

ファイルのスプロケット( )にbootstrap_and_overrides.css.less含まれるファイルを見てください。*= require_treeapplication.css

@iconSpritePathエラーは、またはを含めることで特定できると思います@iconWhiteSpritePath

編集:メソッドには2つの引数が必要です。

asset-url("rails.png", image)  # becomes url(/assets/rails.png)
asset-path("rails.png", image) # becomes "/assets/rails.png"

それが役立つことを願っています

于 2012-05-02T00:10:07.007 に答える