Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
Labels

Comments

@rmontgomery429
Copy link

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
Copy link
Author

This could be related to Issue 98 #98

@rmontgomery429
Copy link
Author

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
Copy link

castus commented Nov 8, 2012

+1

@castus
Copy link

castus commented Nov 9, 2012

I found a simple workaround

https://gist.github.com/4044953

@motioneleven
Copy link

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
Copy link

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
Copy link
Contributor

frodsan commented Apr 30, 2013

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

@edrex
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
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
Copy link

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
Copy link

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
Copy link

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

@henrik
Copy link

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
Labels
Projects
None yet
Development

No branches or pull requests

9 participants