Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
enginecan opened this issue Jun 21, 2023 · 3 comments
Open

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

enginecan opened this issue Jun 21, 2023 · 3 comments

Comments

@enginecan
Copy link

enginecan commented Jun 21, 2023

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"\\\

@enginecan enginecan changed the title build': undefined method []' for nil:NilClass (NoMethodError) build': undefined method []' for nil:NilClass (NoMethodError) Jun 21, 2023
@stuyam
Copy link
Member

stuyam commented Jul 16, 2023

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?

@aneshodza
Copy link

I am also getting this. Anything new?

@MineKing9534
Copy link

MineKing9534 commented Mar 17, 2024

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants