Ruby on rails Manifest.yml空

Ruby on rails Manifest.yml空,ruby-on-rails,ruby-on-rails-3,heroku,asset-pipeline,Ruby On Rails,Ruby On Rails 3,Heroku,Asset Pipeline,每当我运行rakeassets:precompile,我都会得到一个manifest.yml文件,它看起来像: --- {} 一定是出了什么事。以下是我对rake资产的输出:预编译--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.

每当我运行
rakeassets:precompile
,我都会得到一个
manifest.yml
文件,它看起来像:

--- {}
一定是出了什么事。以下是我对
rake资产的输出:预编译--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
有人能帮忙吗??谢谢

更新:
当我运行
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'
    在您的
    Gemfile
    中,这似乎会导致
    bootstrap-sass-2.1.0.1/vendor/assets/stylesheets/bootstrap/_accordion.scss
    (以及其他文件)被添加到您的管道中,即使它们没有包含在
    app/assets/application.css的require行中
看起来您已经包含了引导gem来使用它的Javascript插件,但是您是否正试图省略SASS文件,而使用硬编码、缩小的CSS文件

在任何情况下,我得到的错误都表明,
$baseLineHeight
SASS变量没有为该gem文件的资产中的某一行定义,否则您会忽略该资产(据我所知)

然后我做了下面的事情

  • 注释掉
    gem文件中的
    bootstrap sass
    gem

    #gem 'bootstrap-sass'
    
  • 运行
    bundle

  • Ran
    rake资产:清理
  • 从您的
    app/assets/application.js
    中删除了以下require行,因为它们来自
    bootstrap sass
    gem,我在1中删除了这些行。

    //= require bootstrap-transition
    //= require bootstrap-button
    //= require bootstrap-carousel
    //= require bootstrap-collapse
    //= require bootstrap-tab
    
  • Ran
    rake资产:预编译

  • #gem 'bootstrap-sass'
    
    这将导致出现以下
    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
      所属的地方-
      vendor/assets/stylesheets

    了解有关您的
    应用程序/资产
    库/资产
    供应商/资产
    内容的任何信息,以及您的应用程序的
    应用程序::application.config.assets.precompile
    值的信息都很有用。很抱歉,响应太晚了。我添加了我的github回购。希望有帮助!谢谢你的帮助。很抱歉这么晚才回复。但你是对的!