0

を実行すると、次のようなファイルがrake assets:precompile得られます。manifest.yml

--- {}

何かがうまくいかないはずです。これが私の出力ですrake assets:precompile --trace

** Invoke assets:precompile (first_time)
** Execute assets:precompile
/Users/user/.rvm/rubies/ruby-1.9.3-p194/bin/ruby /Users/user/.rvm/gems/ruby-1.9.3-p194@global/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
** Invoke assets:precompile:nondigest (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:nondigest

誰か助けてくれませんか?? ありがとう!

アップデート:

www.github.com/sambaek/novultyで私のコードを自由に見てください。

4

1 に答える 1

0

rake assets:precompileアプリケーションを実行すると、次の出力が得られます

➜  novulty git:(master) ✗ rake assets:precompile                     
/Users/deefour/.rbenv/versions/1.9.3-p125/bin/ruby /Users/deefour/.rbenv/versions/1.9.3-p125/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
Undefined variable: "$baseLineHeight".
  (in /Users/deefour/.rbenv/versions/1.9.3-p125/gemsets/novulty/gems/bootstrap-sass-2.1.0.1/vendor/assets/stylesheets/bootstrap/_accordion.scss)

Tasks: TOP => assets:precompile:primary
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/Users/deefour/.rbenv/versions/1.9.3-p125/...]

Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
rake assets:precompile  12.50s user 1.21s system 99% cpu 13.744 total

あなたの意図はわかりませんが、あなたは持っています

  • app/asssets/bootstrap.min.css含まれているapp/assets/application.css
  • gem 'bootstrap-sass'これは、(他のファイルの中でも) require行に含まれていなくても、パイプラインに追加されるようにGemfile見えますbootstrap-sass-2.1.0.1/vendor/assets/stylesheets/bootstrap/_accordion.scss app/assets/application.css

Javascript プラグインを使用するためにブートストラップ gem が含まれているようですが、ハードコーディングされた縮小された CSS ファイルを優先して SASS ファイルを省略しようとしていますか?

いずれにせよ、私が得るエラーは、$baseLineHeightSASS変数がそのgemファイルのアセットの行に対して定義されていないことを示しています.

次に、次のことを行いました

  1. bootstrap-sassあなたの宝石をコメントアウトしましたGemfile

    #gem 'bootstrap-sass'
    
  2. ランbundle

  3. ランrake assets:clean
  4. 上記の1.で削除した gemapp/assets/application.jsからのものであるため、次の require 行を削除しました。bootstrap-sass

    //= require bootstrap-transition
    //= require bootstrap-button
    //= require bootstrap-carousel
    //= require bootstrap-collapse
    //= require bootstrap-tab
    
  5. ランrake assets:precompile

これにより、次の結果が得られますpublic/assets/manifest.yml

次のいずれかが必要だと思います

  • bootstrap-sass意図したとおりに gem を使用します。あなたにSASSファイルを含めますapp/assets/application.css (これを行うと、この質問の範囲外になります)
  • 上記のように宝石を取り除きbootstrap-sass、必要なJavascriptファイルをアセットとしてvendor/assets/javascriptsディレクトリに含めます(これもapp/assets/stylesheets/bootstrap.min.css所属する場所です- vendor/assets/stylesheets
于 2012-11-08T03:14:11.900 に答える