actionmailer_inline_css icon indicating copy to clipboard operation
actionmailer_inline_css copied to clipboard

Errno::EACCES: Permission denied

Open fastsyrup opened this issue 9 years ago • 4 comments

Hi,

Just installed premailer (windows 7, ruby 1.9.3p484, rails 4.1.3) and trying to send a css email from the console. I get following error:

irb(main):009:0> BottlyMailer.invitation_email(e, "[email protected]", "Name").deliver
Errno::EACCES: Permission denied - C:/Users/mike/Dropbox/kalenderfee/webapp/public
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionmailer_inline_css-1.5.3/lib/overrides/premailer/premailer.rb:13:in `read'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionmailer_inline_css-1.5.3/lib/overrides/premailer/premailer.rb:13:in `load_css_from_local_file_with_rails_path!'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/premailer-1.8.3/lib/premailer/premailer.rb:306:in `block in load_css_from_html!'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.6.2-x86-mingw32/lib/nokogiri/xml/node_set.rb:187:in `block in each'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.6.2-x86-mingw32/lib/nokogiri/xml/node_set.rb:186:in `upto'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.6.2-x86-mingw32/lib/nokogiri/xml/node_set.rb:186:in `each'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/premailer-1.8.3/lib/premailer/premailer.rb:285:in `load_css_from_html!'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/premailer-1.8.3/lib/premailer/premailer.rb:234:in `initialize'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionmailer_inline_css-1.5.3/lib/action_mailer/inline_css_hook.rb:12:in `new'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionmailer_inline_css-1.5.3/lib/action_mailer/inline_css_hook.rb:12:in `delivering_email'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mail-2.5.4/lib/mail/mail.rb:230:in `block in inform_interceptors'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mail-2.5.4/lib/mail/mail.rb:229:in `each'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mail-2.5.4/lib/mail/mail.rb:229:in `inform_interceptors'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mail-2.5.4/lib/mail/message.rb:220:in `inform_interceptors'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mail-2.5.4/lib/mail/message.rb:230:in `deliver'
        from (irb):9
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.3/lib/rails/commands/console.rb:90:in `start'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.3/lib/rails/commands/console.rb:9:in `start'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.3/lib/rails/commands/commands_tasks.rb:69:in `console'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.3/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.3/lib/rails/commands.rb:17:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'irb(main):010:0>

Here's the template for the mail (haml)

!!!
%html
  %head
    %meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}/
    %title= content_for?(:title) ? yield(:title) : "Kalenderfee"
    %meta{:content => content_for?(:description) ? yield(:description) : "Kalenderfee", :name => "description"}/
    = stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true
    = javascript_include_tag "application", "data-turbolinks-track" => true
  %body
    .application
      .row
        .container
          %p
            Hallo #{@name},
          %p
            = @event.owner.full_name
            möchte dich gerne zu #{@event.name} am #{I18n.l(@event.date.to_date, format: :local_date_short)} einladen. Kannst du dich bitte hierfür unter diesem Link an- oder abmelden? #{@event.owner.first_name} wird dir sicherlich sehr verbunden sein.
          %p
            %li
              %a{:href => event_url(@event)}= event_url(@event)  
          %p
            Danke und lieben Gruss
          %p
            \- Deine Kalenderfee        %footer

Appreciate your help

  • Mike

fastsyrup avatar Feb 11 '15 20:02 fastsyrup

I found that I had to back down the version of dependency gem premailer to 1.7.9

bstrech avatar Feb 26 '15 05:02 bstrech

I was seeing

Errno::EISDIR: Is a directory @ io_fread - /var/app/current/public
from /opt/rubies/ruby-2.1.5/lib/ruby/gems/2.1.0/gems/actionmailer_inline_css-1.5.3/lib/overrides/premailer/premailer.rb:13:in `read'

Which backing down premailer to 1.7.9 also solved.

kevinmarx avatar Jul 29 '15 15:07 kevinmarx

@bstrech @kevinmarx @fastsyrup I had the same problem, solved after downgrade from 1.8.6. to 1.79

wellington1993 avatar Mar 04 '16 12:03 wellington1993

Should be fixed by 6879d32a3139365643796345a231a671beebd484

akzhan avatar Mar 07 '17 22:03 akzhan