Manifest.yml空

时间:2012-11-03 22:00:49

标签: ruby-on-rails ruby-on-rails-3 heroku asset-pipeline

每当我运行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

有人可以帮忙吗?谢谢!

UPDATE:

随时在www.github.com/sambaek/novulty

查看我的代码

1 个答案:

答案 0 :(得分: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'中的{li> Gemfile似乎会导致bootstrap-sass-2.1.0.1/vendor/assets/stylesheets/bootstrap/_accordion.scss (以及其他文件)添加到您的管道中,即使它们未包含在您的管道中需要app/assets/application.css 中的行

看起来你有使用它的Javascript插件包含引导宝石,但是试图省略SASS文件而转而使用硬编码的缩小CSS文件?

无论如何,我得到的错误是没有为该gem文件的资产中的一行定义$baseLineHeight SASS变量 - 否则你似乎忽略了的资产(从我能说的最好的资产) )

然后我做了以下

  1. bootstrap-sass

    中注明了Gemfile gem
    #gem 'bootstrap-sass'
    
  2. bundle

  3. rake assets:clean
  4. app/assets/application.js删除了以下要求行,因为它们来自我在 1 中删除的bootstrap-sass宝石。

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

  6. 这导致以下public/assets/manifest.yml

    我认为你需要以下任何一种

    • 按预期使用bootstrap-sass gem。在您的app/assets/application.css 中加入SASS文件(这样做有点超出了本问题的范围)
    • 删除上面的bootstrap-sass gem,并将必要的Javascript文件作为资源包含在vendor/assets/javascripts目录中(app/assets/stylesheets/bootstrap.min.css所属的地方 - { {1}})