0

Okay. I'm past my wit here.

I've got a rails app that I haven't worked on in about 3 weeks...yet when I left off it did not produce this error anywhere.

I am using the latest versions of many gems yet all of them seem to be working. I'm working under ruby1.9 now and so I upgraded things to match that. I am reasonably sure that is the only significant thing to change since 3 weeks ago.

Many pages render just fine, but one page fails with a NoMethodError "undefined method `children' for nil:NilClass" and the following seemingly framework-only stack trace. For the page in question I have gone so far as to comment out the entire haml page, the controller method, all before_filters, all of application_controller, and a few other things.

I've downgraded haml and compass suspecting that they were the culprits even though other pages render just fine. I'm currently back to the stable branches on everything except, I think devise, but that doesn't seem to be part of the issue because logins work just fine.

activesupport (3.0.7) lib/active_support/whiny_nil.rb:48:in `method_missing'
haml (3.1.1) lib/haml/parser.rb:151:in `parse'
haml (3.1.1) lib/haml/engine.rb:124:in `initialize'
haml (3.1.1) lib/haml/template/plugin.rb:34:in `new'
haml (3.1.1) lib/haml/template/plugin.rb:34:in `compile'
haml (3.1.1) lib/haml/template/plugin.rb:39:in `call'
actionpack (3.0.7) lib/action_view/template.rb:226:in `compile'
actionpack (3.0.7) lib/action_view/template.rb:134:in `block in render'
activesupport (3.0.7) lib/active_support/notifications.rb:54:in `instrument'
actionpack (3.0.7) lib/action_view/template.rb:127:in `render'
actionpack (3.0.7) lib/action_view/render/rendering.rb:59:in `block in _render_template'
activesupport (3.0.7) lib/active_support/notifications.rb:52:in `block in instrument'
activesupport (3.0.7) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.0.7) lib/active_support/notifications.rb:52:in `instrument'
actionpack (3.0.7) lib/action_view/render/rendering.rb:56:in `_render_template'
actionpack (3.0.7) lib/action_view/render/rendering.rb:26:in `render'
haml (3.1.1) lib/haml/helpers/action_view_mods.rb:13:in `render_with_haml'
actionpack (3.0.7) lib/abstract_controller/rendering.rb:115:in `_render_template'
actionpack (3.0.7) lib/abstract_controller/rendering.rb:109:in `render_to_body'
actionpack (3.0.7) lib/action_controller/metal/renderers.rb:47:in `render_to_body'
actionpack (3.0.7) lib/action_controller/metal/compatibility.rb:55:in `render_to_body'
actionpack (3.0.7) lib/abstract_controller/rendering.rb:102:in `render_to_string'
actionpack (3.0.7) lib/abstract_controller/rendering.rb:93:in `render'
actionpack (3.0.7) lib/action_controller/metal/rendering.rb:17:in `render'
actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
activesupport (3.0.7) lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/Users/DeVeLoPeR/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/benchmark.rb:309:in `realtime'
activesupport (3.0.7) lib/active_support/core_ext/benchmark.rb:5:in `ms'
actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:40:in `block in render'
actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:78:in `cleanup_view_runtime'
activerecord (3.0.7) lib/active_record/railties/controller_runtime.rb:15:in `cleanup_view_runtime'
actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:39:in `render'
actionpack (3.0.7) lib/action_controller/metal/implicit_render.rb:14:in `default_render'
actionpack (3.0.7) lib/action_controller/metal/implicit_render.rb:6:in `send_action'
actionpack (3.0.7) lib/abstract_controller/base.rb:150:in `process_action'
actionpack (3.0.7) lib/action_controller/metal/rendering.rb:11:in `process_action'
actionpack (3.0.7) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.0.7) lib/active_support/callbacks.rb:436:in `_run__1376965243214072245__process_action__2201785587746499238__callbacks'
activesupport (3.0.7) lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
activesupport (3.0.7) lib/active_support/callbacks.rb:94:in `run_callbacks'
actionpack (3.0.7) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.0.7) lib/active_support/notifications.rb:52:in `block in instrument'
activesupport (3.0.7) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.0.7) lib/active_support/notifications.rb:52:in `instrument'
actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.0.7) lib/action_controller/metal/rescue.rb:17:in `process_action'
actionpack (3.0.7) lib/abstract_controller/base.rb:119:in `process'
actionpack (3.0.7) lib/abstract_controller/rendering.rb:41:in `process'
actionpack (3.0.7) lib/action_controller/metal.rb:138:in `dispatch'
actionpack (3.0.7) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.0.7) lib/action_controller/metal.rb:178:in `block in action'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:62:in `call'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:27:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `block in call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `block in recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:68:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:493:in `call'
sass (3.1.1) lib/sass/plugin/rack.rb:54:in `call'
warden (1.0.4) lib/warden/manager.rb:35:in `block in call'
warden (1.0.4) lib/warden/manager.rb:34:in `catch'
warden (1.0.4) lib/warden/manager.rb:34:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.2) lib/rack/methodoverride.rb:24:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/flash.rb:182:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/cookies.rb:302:in `call'
activerecord (3.0.7) lib/active_record/query_cache.rb:32:in `block in call'
activerecord (3.0.7) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
activerecord (3.0.7) lib/active_record/query_cache.rb:12:in `cache'
activerecord (3.0.7) lib/active_record/query_cache.rb:31:in `call'
activerecord (3.0.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
activesupport (3.0.7) lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
actionpack (3.0.7) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.2) lib/rack/sendfile.rb:107:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.0.7) lib/rails/rack/logger.rb:13:in `call'
rack (1.2.2) lib/rack/runtime.rb:17:in `call'
activesupport (3.0.7) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.2) lib/rack/lock.rb:11:in `block in call'
<internal:prelude>:10:in `synchronize'
rack (1.2.2) lib/rack/lock.rb:11:in `call'
actionpack (3.0.7) lib/action_dispatch/middleware/static.rb:30:in `call'
railties (3.0.7) lib/rails/application.rb:168:in `call'
railties (3.0.7) lib/rails/application.rb:77:in `method_missing'
railties (3.0.7) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.2) lib/rack/content_length.rb:13:in `call'
rack (1.2.2) lib/rack/handler/webrick.rb:52:in `service'
/Users/DeVeLoPeR/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/Users/DeVeLoPeR/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/Users/DeVeLoPeR/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'

I am starting to think that the change to ruby 1.9.2 has caused this but I can't think how it would. I'm going to pull back to ruby 1.8.7 so I can get working again (hopefully) but our production server runs 1.9.2 so I'll need it at some point.

Any thoughts are appreciated.

Thanks

Edit Downgrading to Ruby1.8.7 Had no effect. I also tried it on another computer without RVM.

Edit Gemfile as requested:

source 'http://rubygems.org'

gem 'rails', '3.0.7'

gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'mysql'

gem "will_paginate", "~> 3.0.pre2"
gem 'activemerchant'

gem 'devise', '1.1.9'

gem 'ruby-debug'
gem 'sslrequirement'
gem 'cancan'
gem 'rmagick'
gem 'carrierwave', "~> 0.5.3"
gem 'haml'
gem 'compass'
#gem 'mongrel'
gem 'jquery-rails'

group :development, :test do
  gem 'webrat'
  gem 'wirble'
end
voxobscuro
  • 2,132
  • 1
  • 21
  • 45
  • Did you bundle install after updating gems? Just trying to make sure everything is covered. And, are you using Kaminari, can you post your Gemfile? – Caley Woods May 06 '11 at 17:50
  • The Haml file is failing to parse. You should post it. Also, turn on 'list' or 'show invisibles' in your editor to double-check the indentation. Haml is pretty particular about whitespace. – Austin Taylor May 06 '11 at 18:14
  • Caley Woods - I'll post my gemfile here in a second. I have no idea what Kaminari is...so...probably not. – voxobscuro May 06 '11 at 18:48
  • Austin Taylor - I actually edit with :set list all the time. The file hasn't changed since it was last working and is currently blank...so posting it probably won't do any good. Thanks for looking. – voxobscuro May 06 '11 at 18:49

1 Answers1

4

Do you use HAML comments (-#)? Removing them worked for me.

rbq
  • 136
  • 4
  • Raven - Yes. This ended up being my issue as well. I think there is something buggy with the haml processor given certain circumstances and haml comments. It doesn't happen with every haml comment though. I started digging around to see what is going on but I didn't really have the time to dig at the time. – voxobscuro May 09 '11 at 18:46