markets / maily

📫 Rails Engine to preview emails in the browser
https://rubygems.org/gems/maily
MIT License
707 stars 31 forks source link

Breaks if sass-rails is not present #22

Closed pcriv closed 6 years ago

pcriv commented 6 years ago

Description

On an application i have, we are mainly not using the asset pipeline and we use the webpacker gem instead. (webpack) So that's why we don't have sass-rails on our Gemfile.

Adding the gem fixes the issue but maybe this gem should require it?

markets commented 6 years ago

Hi @pablocrivella and thanks for reporting!

You're totally right, sass-rails should be an explicit dependency of Maily.

pcriv commented 6 years ago

FYI: I also had to add maily/logo.png to:

Rails.application.config.assets.precompile += %w[maily/logo.png]
markets commented 6 years ago

@pablocrivella I just pushed a branch (#23) to fix this, will ping you when this is ready, thanks!

markets commented 6 years ago

@pablocrivella v0.7.1 (diff) released 🚀 fixing this stuff. Let me know if this version works for your app with webpacker. Thanks!

RubyGems: https://rubygems.org/gems/maily/versions/0.7.1

pcriv commented 6 years ago

Now i'm getting the following error.

Showing /Users/pablocrivella/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/maily-0.7.1/app/views/layouts/maily/application.html.erb where line #5 raised:

File to import not found or unreadable: maily/normalize.
Load paths:
  /Users/pablocrivella/Workspace/Inspire/Ruby/NanaBackend/app/assets/stylesheets
  /Users/pablocrivella/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/maily-0.7.1/app/assets/images
  /Users/pablocrivella/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/maily-0.7.1/app/assets/javascripts
  /Users/pablocrivella/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/maily-0.7.1/app/assets/stylesheets
  /Users/pablocrivella/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/foundation_emails-2.2.1.0/vendor/assets/stylesheets
  /Users/pablocrivella/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/actioncable-5.2.0/lib/assets/compiled
  /Users/pablocrivella/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activestorage-5.2.0/app/assets/javascripts
  /Users/pablocrivella/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/actionview-5.2.0/lib/assets/compiled

Works after adding sass-rails again to the Gemfile

pcriv commented 6 years ago

@markets Maybe we should re-open this issue?

markets commented 6 years ago

Yep, will look into this again.

markets commented 6 years ago

@pablocrivella could you please share more info about your setup? Rails 5.2.0 with webpacker without sass-rails? Would be really helpful to have a sample app that reproduces the error.

pcriv commented 6 years ago

Just some of the relevant gems:

ruby "2.5.1"

gem "rails", "~> 5.2.0"

gem "bootsnap", ">= 1.1.0", require: false
gem "foundation_emails"
gem "inky-rb", require: "inky"
gem "komponent"
gem "pg", ">= 0.18", "< 2.0"
gem "premailer-rails"
gem "rails-i18n", "~> 5.1"
gem "slim-rails"
gem "webpacker"
markets commented 6 years ago

@pablocrivella finally fixed (I hope) in v0.7.2 :)

pcriv commented 6 years ago

Fix confirmed! Thanks @markets Awesome job!! 🎉