Ruby on rails 3.2 Ruby Rails 3.2 mailer在生产中抛出错误没有这样的文件来加载sass

Ruby on rails 3.2 Ruby Rails 3.2 mailer在生产中抛出错误没有这样的文件来加载sass,ruby-on-rails-3.2,sass,actionmailer,premailer,Ruby On Rails 3.2,Sass,Actionmailer,Premailer,我正在使用GlassFish 3.1上托管的JRuby 1.7.3 Rails 3.2.13。我正在使用premailer rails内联css以发送电子邮件。在开发中工作正常。但产品给出了错误:“LoadError(没有这样的文件要加载--sass” (在../apps/assets/stylesheets/bootstrap_和_override.css.scss中) 我不明白为什么它在生产中失败了。如果我使用只包含mail.css的mailer布局,我不知道为什么它还会尝试包含bootst

我正在使用GlassFish 3.1上托管的JRuby 1.7.3 Rails 3.2.13。我正在使用premailer rails内联css以发送电子邮件。在开发中工作正常。但产品给出了错误:“LoadError(没有这样的文件要加载--sass” (在../apps/assets/stylesheets/bootstrap_和_override.css.scss中)


我不明白为什么它在生产中失败了。如果我使用只包含mail.css的mailer布局,我不知道为什么它还会尝试包含bootstrap和override.css并抛出该错误。有什么想法吗?

找到了根本原因。需要将预编译器rails放在assets组中,以便asset precompile将转换内联css。
layouts/mailer.html.haml
    = stylesheet_link_tag "mail"
    %style{:type => "text/css"}


configuration/application.rb
    config.assets.precompile += ['mail.css']

app/assets/stylesheets/mail.css.scss
    h2.mail {
        color: #2871a8;
    }
app/assets/stylesheets/bootstrap_and_override.css.scss
    @import "twitter/bootstrap";

Gemfile
    group :assets do
        gem 'bootstrap-sass-rails'
        gem 'sass-rails'
        gem 'coffee-rails'
        gem 'therubyrhino'
        gem 'uglifier'
    end
    gem 'premailer-rails'