0

I'm having problems using Mailer from the command prompt in my production environment. Using this command

Mailer.function.deliver

Gives this error

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 >

I can correct the problem if I delete the 'public/assets' folder, however this causes the rest of the production website to fail at loading images/css, etc.

I precompile my assets using this command rake assets:precompile

Mark Bathie
  • 180
  • 1

1 Answers1

0

Figured it out. Seems in production for rails 3.1 pre-compiled assets pipeline, premailer requires you have at least a blank email.css under app/assets/stylesheets before you pre-compile your assets.

Mark Bathie
  • 180
  • 1