0

我在生产环境的命令提示符下使用 Mailer 时遇到问题。使用此命令

Mailer.function.deliver

给出这个错误

Errno::ENOTDIR: Not a directory - /assets/
from /home/rails/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/open-uri.rb:35:in `initialize'
from /home/rails/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/open-uri.rb:35:in `open'
from /home/rails/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/open-uri.rb:35:in `open'
from /home/rails/.rvm/gems/ruby-1.9.3-p194/gems/premailer-rails3-1.2.0/lib/premailer-rails3/css_helper.rb:70:in `request_and_unzip'
from /home/rails/.rvm/gems/ruby-1.9.3-p194/gems/premailer-rails3-1.2.0/lib/premailer-rails3/css_helper.rb:45:in `load_css_at_path'
from /home/rails/.rvm/gems/ruby-1.9.3-p194/gems/premailer-rails3-1.2.0/lib/premailer-rails3/css_helper.rb:15:in `css_for_doc'
from /home/rails/.rvm/gems/ruby-1.9.3-p194/gems/premailer-rails3-1.2.0/lib/premailer-rails3/premailer.rb:14:in `initialize'
from /home/rails/.rvm/gems/ruby-1.9.3-p194/gems/premailer-rails3-1.2.0/lib/premailer-rails3/hook.rb:18:in `new'
from /home/rails/.rvm/gems/ruby-1.9.3-p194/gems/premailer-rails3-1.2.0/lib/premailer-rails3/hook.rb:18:in `delivering_email'
from /home/rails/.rvm/gems/ruby-1.9.3-p194/gems/mail-2.3.3/lib/mail/mail.rb:230:in `block in inform_interceptors'
from /home/rails/.rvm/gems/ruby-1.9.3-p194/gems/mail-2.3.3/lib/mail/mail.rb:229:in `each'
from /home/rails/.rvm/gems/ruby-1.9.3-p194/gems/mail-2.3.3/lib/mail/mail.rb:229:in `inform_interceptors'
from /home/rails/.rvm/gems/ruby-1.9.3-p194/gems/mail-2.3.3/lib/mail/message.rb:218:in `inform_interceptors'
from /home/rails/.rvm/gems/ruby-1.9.3-p194/gems/mail-2.3.3/lib/mail/message.rb:228:in `deliver'
from (irb):1
from /home/rails/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.1.1/lib/rails/commands/console.rb:45:in `start'
from /home/rails/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.1.1/lib/rails/commands/console.rb:8:in `start'
from /home/rails/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.1.1/lib/rails/commands.rb:40:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'1.9.3-p194 :002 >

如果我删除“public/assets”文件夹,我可以更正问题,但这会导致生产网站的其余部分无法加载图像/css 等。

我使用此命令预编译我的资产rake assets:precompile

4

1 回答 1

0

弄清楚了。email.css似乎在生产 rails 3.1 预编译资产管道,premailer 要求您在预编译资产之前至少有一个空白app/assets/stylesheets

于 2012-06-18T02:55:15.940 回答