sass-rails: image_url is undefined method `[]' for nil:NilClass
Using the 3.2.4 gem, only in production on first query; subsequent queries work fine
NoMethodError (undefined method `[]' for nil:NilClass):
vendor/bundle/ruby/1.9.1/gems/sass-rails-3.2.4/lib/sass/rails/helpers.rb:32:in `resolver'
vendor/bundle/ruby/1.9.1/gems/sass-rails-3.2.4/lib/sass/rails/helpers.rb:25:in `image_url'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/script/funcall.rb:88:in `_perform'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/script/node.rb:40:in `perform'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/script/list.rb:69:in `block in _perform'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/script/list.rb:69:in `map'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/script/list.rb:69:in `_perform'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/script/node.rb:40:in `perform'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/script/list.rb:69:in `block in _perform'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/script/list.rb:69:in `map'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/script/list.rb:69:in `_perform'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/script/node.rb:40:in `perform'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:216:in `visit_prop'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:37:in `visit'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:18:in `visit'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:201:in `block (2 levels) in visit_mixin'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:201:in `map'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:201:in `block in visit_mixin'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:39:in `with_environment'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:201:in `visit_mixin'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:37:in `visit'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:18:in `visit'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:53:in `block in visit_children'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:53:in `map'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:53:in `visit_children'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:27:in `block in visit_children'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:39:in `with_environment'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:26:in `visit_children'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:37:in `block in visit'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:238:in `visit_rule'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:37:in `visit'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:18:in `visit'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:53:in `block in visit_children'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:53:in `map'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:53:in `visit_children'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:27:in `block in visit_children'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:39:in `with_environment'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:26:in `visit_children'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:37:in `block in visit'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:238:in `visit_rule'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:37:in `visit'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:18:in `visit'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:53:in `block in visit_children'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:53:in `map'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:53:in `visit_children'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:27:in `block in visit_children'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:39:in `with_environment'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:26:in `visit_children'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:37:in `block in visit'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:238:in `visit_rule'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:37:in `visit'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:18:in `visit'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:146:in `block in visit_import'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:146:in `map'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:146:in `visit_import'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:37:in `visit'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:18:in `visit'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:146:in `block in visit_import'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:146:in `map'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:146:in `visit_import'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:37:in `visit'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:18:in `visit'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:53:in `block in visit_children'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:53:in `map'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:53:in `visit_children'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:27:in `block in visit_children'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:39:in `with_environment'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:26:in `visit_children'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:37:in `block in visit'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:47:in `visit_root'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/base.rb:37:in `visit'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:18:in `visit'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/visitors/perform.rb:7:in `visit'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/tree/root_node.rb:20:in `render'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/engine.rb:299:in `_render'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/engine.rb:246:in `render'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/plugin/compiler.rb:339:in `update_stylesheet'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/plugin/compiler.rb:202:in `block in update_stylesheets'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/plugin/compiler.rb:200:in `each'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/plugin/compiler.rb:200:in `update_stylesheets'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/plugin.rb:81:in `update_stylesheets'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/plugin.rb:54:in `check_for_updates'
vendor/bundle/ruby/1.9.1/gems/sass-3.1.15/lib/sass/plugin/rack.rb:51:in `call'
vendor/bundle/ruby/1.9.1/gems/warden-1.1.1/lib/warden/manager.rb:35:in `block in call'
vendor/bundle/ruby/1.9.1/gems/warden-1.1.1/lib/warden/manager.rb:34:in `catch'
vendor/bundle/ruby/1.9.1/gems/warden-1.1.1/lib/warden/manager.rb:34:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/etag.rb:23:in `call'
vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/conditionalget.rb:25:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/head.rb:14:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/flash.rb:242:in `call'
vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context'
vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/cookies.rb:338:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:405:in `_run__3718529300652309739__call__2905389853994320807__callbacks'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:405:in `__run_callback'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/rack/logger.rb:26:in `call_app'
vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/rack/logger.rb:16:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/request_id.rb:22:in `call'
vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/static.rb:53:in `call'
vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
vendor/bundle/ruby/1.9.1/gems/airbrake-3.0.9/lib/airbrake/user_informer.rb:12:in `call'
vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/engine.rb:479:in `call'
vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/application.rb:220:in `call'
vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/static.rb:66:in `call'
vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/connection.rb:80:in `block in pre_process'
vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/connection.rb:78:in `catch'
vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/connection.rb:78:in `pre_process'
vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/connection.rb:53:in `process'
vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/connection.rb:38:in `receive_data'
vendor/bundle/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
vendor/bundle/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/backends/base.rb:61:in `start'
vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/server.rb:159:in `start'
vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/controllers/controller.rb:86:in `start'
vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/runner.rb:185:in `run_command'
vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/runner.rb:151:in `run!'
vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/bin/thin:6:in `<top (required)>'
vendor/bundle/ruby/1.9.1/bin/thin:19:in `load'
vendor/bundle/ruby/1.9.1/bin/thin:19:in `<main>'
About this issue
- Original URL
- State: closed
- Created 12 years ago
- Comments: 19 (5 by maintainers)
This problem occurs when you use .css file instead of .scss
You’re right guys. It’s my fault, I used image-url in plain-css file. It may be worth to add some checks or more descriptive error message?