sighmon / mjml-rails

MJML + ERb/Haml/Slim view template
https://mjml.io
Other
296 stars 64 forks source link

support for mjml 4.1.0 #32

Closed alebacca89 closed 6 years ago

alebacca89 commented 6 years ago

The last version of mjml is 4.1.0 but mjml-rails not recognise this bin. If I install mjml 4.0.0 with npm, npm install 4.1.0. (npm install mjml@4.0.0) If I use mjml-rails setup in a initializer and I put

Mjml.setup do |config| config.mjml_binary_version_supported = "4.1." end

not works.

sighmon commented 6 years ago

@alebacca89 did you mean to put this in the config:

Mjml.setup do |config|
  config.mjml_binary_version_supported = "4.0."
end
sbiastoch commented 6 years ago

Same problem here, when I install mjml@4.0.5, mjml --version gives me 4.1.1 Seems like an old issue, see https://github.com/mjmlio/mjml/issues/371

Setting mjml_binary_version_supported does not help neither.

sighmon commented 6 years ago

@biastoch2 are you installing it locally or globally? try npm install -g mjml@4.0.5 and then let me know what mjml --version gives you.

sbiastoch commented 6 years ago

I tried both, locally and globally, as well as uninstalling, force cleaning the npm cache and reinstalling mjml. Always mjml --version gives

mjml-core: 4.1.1
mjml-cli: 4.1.1

I also tried installing mjml-core@4.0.5 and mjml-cli@4.0.5 but still 4.1.1.

sighmon commented 6 years ago

@biastoch2 Oh I see - I just got home to try it and have the same result. Would npm installing from git work for the tagged release 4.0.5?

(I don't use npm much, so just guessing)

sbiastoch commented 6 years ago

No luck, there is no version-attribute in the package.json present, such that npm install mjmlio/mjml#v4.0.5 (which installs mjml directely from github) fails with: npm ERR! Can't install github:mjmlio/mjml#ecfb19d227f232a29b7f4059849f3aa01ce22386: Missing package version.

sbiastoch commented 6 years ago

I was able to get mjml back to work using the master-branch of mjml-rails in my Gemfile. The master branch uses mjml in version 4.1., but when bundle install, rails pulls the latest version of mjml-rails, which is 4.0, which references mjml 4.0., which is due to the described bug of mjml currently not installable. A new release of mjml-rails would temporarily fix this problem until the releases get out of sync again.

Still weird, that the manual change of mjml_binary_version_supported from inside the initializer does not work...

sighmon commented 6 years ago

@biastoch2 I don't think I understand your problem - the latest version of mjml-rails in Rubygems is 4.2.0. Does it update to 4.2.0 when you do a bundle update?

sighmon commented 6 years ago

Wondering if this was related to https://github.com/sighmon/mjml-rails/issues/36#issuecomment-416926743