sighmon/mjml-rails

Cannot find MJML bin.

Closed this issue · 1 comments

Opening this task early while I continue to debug:

[7] pry(main)> reload!; UserMailer.confirmation_instructions(User.first, '123').deliver
Reloading...
   (1.0ms)  SET NAMES utf8mb4 COLLATE utf8mb4_bin,  @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'),  @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
  User Load (0.4ms)  SELECT  `users`.* FROM `users` ORDER BY `users`.`id` ASC LIMIT 1
  Postcard Load (0.6ms)  SELECT  `postcards`.* FROM `postcards` WHERE `postcards`.`user_id` = 2 ORDER BY `postcards`.`id` DESC LIMIT 1
  Rendering users/mailer/confirmation_instructions.mjml within layouts/mailer
  Rendered users/mailer/confirmation_instructions.mjml within layouts/mailer (41.1ms)
  Rendering users/mailer/confirmation_instructions.mjml within layouts/mailer
  Rendered users/mailer/confirmation_instructions.mjml within layouts/mailer (8.7ms)
UserMailer#confirmation_instructions: processed outbound mail in 137.1ms
ActionView::Template::Error: Couldn't find the MJML binary.. have you run $ npm install mjml?
from /Users/amirsharif/.rvm/gems/ruby-2.4.1/gems/mjml-rails-2.4.3/lib/mjml/parser.rb:8:in `initialize'
[8] pry(main)> Mjml::BIN
=> nil
[9] pry(main)> Mjml.discover_mjml_bin
=> "/Users/amirsharif/Projects/sapco/node_modules/.bin/mjml"
[10] pry(main)> reload!; UserMailer.confirmation_instructions(User.first, '123').deliver
Reloading...
  User Load (0.9ms)  SELECT  `users`.* FROM `users` ORDER BY `users`.`id` ASC LIMIT 1
  Postcard Load (0.4ms)  SELECT  `postcards`.* FROM `postcards` WHERE `postcards`.`user_id` = 2 ORDER BY `postcards`.`id` DESC LIMIT 1
  Rendering users/mailer/confirmation_instructions.mjml within layouts/mailer
  Rendered users/mailer/confirmation_instructions.mjml within layouts/mailer (17.2ms)
  Rendering users/mailer/confirmation_instructions.mjml within layouts/mailer
  Rendered users/mailer/confirmation_instructions.mjml within layouts/mailer (16.3ms)
UserMailer#confirmation_instructions: processed outbound mail in 102.1ms
ActionView::Template::Error: Couldn't find the MJML binary.. have you run $ npm install mjml?
from /Users/amirsharif/.rvm/gems/ruby-2.4.1/gems/mjml-rails-2.4.3/lib/mjml/parser.rb:8:in `initialize'
[11] pry(main)> Mjml::BIN
=> nil
[12] pry(main)> Mjml::BIN = Mjml.discover_mjml_bin
(pry):12: warning: already initialized constant Mjml::BIN
/Users/amirsharif/.rvm/gems/ruby-2.4.1/gems/mjml-rails-2.4.3/lib/mjml.rb:33: warning: previous definition of BIN was here
=> "/Users/amirsharif/Projects/sapco/node_modules/.bin/mjml"

Just had to restart it I guess.