NoMethodError on line ["32"] lib/sass/rails/helpers.rb: undefined method '[]' for nil:NilClass #121

Closed
rmontgomery429 opened this Issue Oct 11, 2012 · 16 comments

Comments

Projects
None yet
10 participants
@rmontgomery429

I'm running bundle exec compass compile -e production --force and I'm getting

NoMethodError on line ["32"] of /Users/rmontgomery429/.rvm/gems/ruby-1.9.3-p194@usertesting-orders/gems/sass-rails-3.2.5/lib/sass/rails/helpers.rb: undefined method '[]' for nil:NilClass

That code in question is this: lib/sass/rails/helpers.rb:32

31: def resolver
32:   options[:custom][:resolver]
33: end

I added a binding.pry to the resolver method and options[:custom] returns nil.

def resolver
  binding.pry if options[:custom].nil?
  options[:custom][:resolver]
end

options.has_key? :custom returns false.

@rmontgomery429

This comment has been minimized.

Show comment
Hide comment
@rmontgomery429

rmontgomery429 Oct 11, 2012

This could be related to Issue 98 #98

This could be related to Issue 98 #98

@rmontgomery429

This comment has been minimized.

Show comment
Hide comment
@rmontgomery429

rmontgomery429 Oct 11, 2012

Ok. On a hunch, I enabled the asset pipeline. Now it seems to work. I think this is because the Resolver is not correctly enabled without it. It appears that the template_handler is not used at all without the asset pipeline being enabled. but it could also be something janky in compass... I'm not sure. Stil digging.

Ok. On a hunch, I enabled the asset pipeline. Now it seems to work. I think this is because the Resolver is not correctly enabled without it. It appears that the template_handler is not used at all without the asset pipeline being enabled. but it could also be something janky in compass... I'm not sure. Stil digging.

@castus

This comment has been minimized.

Show comment
Hide comment

castus commented Nov 8, 2012

+1

@castus

This comment has been minimized.

Show comment
Hide comment
@castus

castus Nov 9, 2012

I found a simple workaround

https://gist.github.com/4044953

castus commented Nov 9, 2012

I found a simple workaround

https://gist.github.com/4044953

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Dec 13, 2012

We got the same error because we had image-url in a plain .css file. Renaming to .css.scss did the trick.
Thought I'd let you know.

ghost commented Dec 13, 2012

We got the same error because we had image-url in a plain .css file. Renaming to .css.scss did the trick.
Thought I'd let you know.

@dpritchett

This comment has been minimized.

Show comment
Hide comment
@dpritchett

dpritchett Feb 1, 2013

lib/sass/rails/helpers.rb:L32 does not exist anymore, this functionality appears to have been farmed out to sprockets/sass_functions. Can this issue be closed?

The problem itself may still be around but the error signature will have moved to another place.

lib/sass/rails/helpers.rb:L32 does not exist anymore, this functionality appears to have been farmed out to sprockets/sass_functions. Can this issue be closed?

The problem itself may still be around but the error signature will have moved to another place.

@frodsan

This comment has been minimized.

Show comment
Hide comment
@frodsan

frodsan Apr 30, 2013

Contributor

Closing here, because does not exist anymore. Feel free to re-open if persists.

Contributor

frodsan commented Apr 30, 2013

Closing here, because does not exist anymore. Feel free to re-open if persists.

@edrex

This comment has been minimized.

Show comment
Hide comment
@edrex

edrex Jun 3, 2013

I don't understand. This is broken in Rails 3.2.13. Are you dropping support for Rails 3.2?

edrex commented Jun 3, 2013

I don't understand. This is broken in Rails 3.2.13. Are you dropping support for Rails 3.2?

@joallard

This comment has been minimized.

Show comment
Hide comment
@joallard

joallard Aug 27, 2013

Confirming for SR 3.2.6 in Rails 3.2.14. It seems that loading a plain CSS with a font is the problem in my reproduction.

Confirming for SR 3.2.6 in Rails 3.2.14. It seems that loading a plain CSS with a font is the problem in my reproduction.

@joallard

This comment has been minimized.

Show comment
Hide comment
@joallard

joallard Aug 27, 2013

Apparent cause: I had "font-url" functions (asset-url instructions) in a plain CSS file. The stack trace/exception could be a little more helpful.

Apparent cause: I had "font-url" functions (asset-url instructions) in a plain CSS file. The stack trace/exception could be a little more helpful.

@wiggly

This comment has been minimized.

Show comment
Hide comment
@wiggly

wiggly Nov 6, 2013

Just another data point, I hit this issue and have spent far too long trying to figure out that I accidentally put a sass helper function into a plan CSS file.

wiggly commented Nov 6, 2013

Just another data point, I hit this issue and have spent far too long trying to figure out that I accidentally put a sass helper function into a plan CSS file.

@joallard

This comment has been minimized.

Show comment
Hide comment
@joallard

joallard Nov 6, 2013

Exactly my case from 2 months ago!

joallard commented Nov 6, 2013

Exactly my case from 2 months ago!

domcleal pushed a commit to domcleal/katello that referenced this issue Dec 10, 2013

fix building on F18
addressing several problems.
compass compile is dissabled because of
rails/sass-rails#121

apipie is disabled because it tries to connect somewhere and fails to connect
@chuckbergeron

This comment has been minimized.

Show comment
Hide comment
@chuckbergeron

chuckbergeron Jul 16, 2014

This bit me the other day while I was trying to deploy to a staging env. I just tried to reproduce it with the latest rails (4.1.4) and sass-rails but I'm unable to repro it now. If anyone could provide me with a failing test app, I could spend time improving the exception message. Cheers.

This bit me the other day while I was trying to deploy to a staging env. I just tried to reproduce it with the latest rails (4.1.4) and sass-rails but I'm unable to repro it now. If anyone could provide me with a failing test app, I could spend time improving the exception message. Cheers.

@wiggly

This comment has been minimized.

Show comment
Hide comment
@wiggly

wiggly Jul 16, 2014

Just tried to reproduce on a rails 3.2.15 / sass-rails 3.2.3 and a rails 4.1.1 / sass-rails 4.0.3 app and neither break but I am not using the exact code that was killing my app last time.

wiggly commented Jul 16, 2014

Just tried to reproduce on a rails 3.2.15 / sass-rails 3.2.3 and a rails 4.1.1 / sass-rails 4.0.3 app and neither break but I am not using the exact code that was killing my app last time.

@chuckbergeron

This comment has been minimized.

Show comment
Hide comment
@chuckbergeron

chuckbergeron Aug 24, 2014

@wiggly Yeah, same problem here. Oh well! I'll keep an eye to see if it comes up again.

@wiggly Yeah, same problem here. Oh well! I'll keep an eye to see if it comes up again.

@henrik

This comment has been minimized.

Show comment
Hide comment
@henrik

henrik Feb 26, 2015

I got this error trying to precompile assets in Rails 3 (with sass-rails-3.2.6) using Uglifier 2. Since Uglifier 2 is declared as backwards-incompatible, I guess it might simply be that these versions of these libs are incompatible. Rails 3 can't use a later version of sass-rails.

henrik commented Feb 26, 2015

I got this error trying to precompile assets in Rails 3 (with sass-rails-3.2.6) using Uglifier 2. Since Uglifier 2 is declared as backwards-incompatible, I guess it might simply be that these versions of these libs are incompatible. Rails 3 can't use a later version of sass-rails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment