Skip to content

build': undefined method []' for nil:NilClass (NoMethodError) #233

Open

Description

@enginecan

What version of Bootstrap Email are you using?

1.4.0

How are you compiling?

Ruby

Code example

I am getting this error. Any idea what's causing this?

Describe your issue

"/usr/local/rvm/gems/ruby-2.6.6/gems/bootstrap-email-1.4.0/lib/bootstrap-email/converters/body.rb:8:in build': undefined method []' for nil:NilClass (NoMethodError)\n\tfrom /usr/local/rvm/gems/ruby-2.6.6/gems/bootstrap-email-1.4.0/lib/bootstrap-email/converters/base.rb:14:in build'\n\tfrom /usr/local/rvm/gems/ruby-2.6.6/gems/bootstrap-email-1.4.0/lib/bootstrap-email/compiler.rb:72:in compile_html'\n\tfrom /usr/local/rvm/gems/ruby-2.6.6/gems/bootstrap-email-1.4.0/lib/bootstrap-email/compiler.rb:34:in perform_html_compile'\n\tfrom /usr/local/rvm/gems/ruby-2.6.6/gems/bootstrap-email-1.4.0/lib/bootstrap-email/bootstrap_email_cli.rb:91:in public_send'\n\tfrom /usr/local/rvm/gems/ruby-2.6.6/gems/bootstrap-email-1.4.0/lib/bootstrap-email/bootstrap_email_cli.rb:91:in <top (required)>'\n\tfrom /usr/local/rvm/gems/ruby-2.6.6/gems/bootstrap-email-1.4.0/bin/bootstrap-email:4:in require_relative'\n\tfrom /usr/local/rvm/gems/ruby-2.6.6/gems/bootstrap-email-1.4.0/bin/bootstrap-email:4:in <top (required)>'\n\tfrom /usr/local/rvm/gems/ruby-2.6.6/bin/bootstrap-email:23:in load'\n\tfrom /usr/local/rvm/gems/ruby-2.6.6/bin/bootstrap-email:23:in <main>'\n\tfrom /usr/local/rvm/gems/ruby-2.6.6/bin/ruby_executable_hooks:24:in eval'\n\tfrom /usr/local/rvm/gems/ruby-2.6.6/bin/ruby_executable_hooks:24:in <main>'\n"\\\

Activity

  1. changed the title [-]`build': undefined method `[]' for nil:NilClass (NoMethodError)[/-] [+]build': undefined method []' for nil:NilClass (NoMethodError)[/+] on Jun 21, 2023
  2. stuyam commented on Jul 16, 2023

    @stuyam
    Member

    Could you share a bit more about your setup and maybe some code examples so I may be able to help you better? Maybe the HTML you are trying to run this on also?

  3. aneshodza commented on Feb 22, 2024

    @aneshodza

    I am also getting this. Anything new?

  4. MineKing9534 commented on Mar 17, 2024

    @MineKing9534

    I also get this error, but only when running the command using a gradle task. When executing bootstrap-email manually everything works fine but using a Exec gradle task that should automate the building process I get this error

           body.inner_html = template('body', classes: "#{body['class']} body", contents: body.inner_html)
                                                               ^^^^^^^^^
            from /usr/local/share/gems/gems/bootstrap-email-1.4.1/lib/bootstrap-email/converters/base.rb:14:in `build'
            from /usr/local/share/gems/gems/bootstrap-email-1.4.1/lib/bootstrap-email/compiler.rb:72:in `compile_html'
            from /usr/local/share/gems/gems/bootstrap-email-1.4.1/lib/bootstrap-email/compiler.rb:34:in `perform_html_compile'
            from /usr/local/share/gems/gems/bootstrap-email-1.4.1/lib/bootstrap-email/bootstrap_email_cli.rb:93:in `public_send'
            from /usr/local/share/gems/gems/bootstrap-email-1.4.1/lib/bootstrap-email/bootstrap_email_cli.rb:93:in `<top (required)>'
            from /usr/local/share/gems/gems/bootstrap-email-1.4.1/bin/bootstrap-email:4:in `require_relative'
            from /usr/local/share/gems/gems/bootstrap-email-1.4.1/bin/bootstrap-email:4:in `<top (required)>'
            from /bin/bootstrap-email:25:in `load'
            from /bin/bootstrap-email:25:in `<main>'
    
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions