Closed RalphAtHamburg closed 9 years ago
looks like this is coming from 59c77249f91d21c700b58baa836941f43ba3b43f as theres no Resolver
in sass-rails since... downgrading to 1.2.0 helps :)
@kangguru thanks for pointing that out! Do you maybe have a fix for that? I’m not working with any Rails 4.x right now.
Just found some time have a closer look at this issue. The problem wasn't the move from rails 4.1 -> 4.2. As @kangguru mentioned its coming from 59c7724 Reverting the changes solves the error. I am wondering if we can revoke this commit?
I would suggest we need some test cases. @derfred could you join the discussion?
ok I'll look into it. My change was due to using image-path
which failed in the precompile step. The lookup here (hence the Resolver
class) must have changed.
I won't be able to do this today, but definitely this week.
yea. somthing has been changed there. first step should be to extend the check existence of Sass::Rails::Resolver
but is seems like we need to come up with something for sass-rails > 3.x
@derfred where did you use image-path
? in a stylesheet or the styleguide
@kangguru in a stylesheet. I only tried it in a Rails 3.2 app with sass-rails 3.2.5.
This commit removes the resolver https://github.com/rails/sass-rails/commit/d357b0194015b05bf54f25ab7be6d6add5a91d1f
Please check #106.
So here's the story: In sass-rails < 4.0 the asset path helpers like image-url
were implemented in sass-rails with the help of the Resolver class. In 4.0 those helpers delegate to sprockets. Now in 5.0 the resolver which was no longer used is removed.
@kangguru I think just extending the existence check like I did in my pull request is sufficient. I tested the following combinations:
They all work and do the right thing, ie embed the correct asset url.
cool thing! thx for the effort to check it out on different versions of sass-rails
Thank you, awesome! :)
@kangguru @RalphAtHamburg would you mind testing it before I release?
works for me :) as far as i can tell.
this is something i have in my stylesheet:
&.as-mobile
+retina-background(image-path('leistungen_mobile.jpg'), image-path('leistungen_mobile@2x.jpg'))
this is how i use it in the styleguide
%li
.a-hero-list-box.as-mobile
.a-hero-list-box--title Mobile Foo
yields no error. @derfred this the usecase when you encountered the issue, correct?
@kangguru yes that was my exact use case.
works for me:
\o/
i'm using rails 4.1.6, sass-rails 5.0.1, sprockets 2.12.3 but still got uninitialized constant Sass::Rails::Resolver it seem **Sass::Rails::Resolver"" only exist in sass-rails >= 3.x
hm, are you using the correct reference in your Gemfile?
https://github.com/konvenit/livingstyleguide/tree/fix_the_fix_of_the_fix
this fix isn't yet in hagenburger/master
I’ll prepare a release right now :)
I had a deep look into sprockets
, sprockets-rails
, sass-rails
, tilt
, and middleman
which led into a complete refactoring. Having the new code, LSG should render Sass exactly the same way Rails/Middleman does and provide access to all helpers and load paths. The fix for this issue should be obsolete. But it needs to be tested with different Rails version combinations.
This will be available from 2.0.0.alpha.3 on.
I just started porting the desksurfing LGS to the new LSG2 style, so we will have it tested on Rails 4.2 (ruby 2.2)
@RalphAtHamburg looking forward to hear your experiences!
After updating to rails 4.2 , sass-rails 5.1, compass 1.01 (via compas-rails) deploying to heroku causes the following error:
The local development environment works fine. Maybe it’s something with compass. Commenting out "@import compass" in application.css.scss shows the same error in the development environment.