Try updating to the latest stable branch of Haml (
http://github.com/nex3/haml/commits/stable), and see if the error still
occurs.

On Wed, Mar 17, 2010 at 4:24 PM, anywho <[email protected]> wrote:

> Using rails3 and just installed haml and ran haml --rails myapp
>
> I get "undefined method `html_safe' for nil:NilClass"
>
> Error when trying to access form_for @user
>
> The rails error is quite uninteresting and can be seen here:
> http://pastie.org/874602
>
> I added
>
> class NilClass
>  def html_safe
>   Rails.logger.info caller.pretty_inspect
> end
> end
>
> To get some more useful information, and below is the result.  I'm a
> haml noob and I don't know what to make of this.
>
> All other pages I have render just fine
>
>
> Rendered users/_form.erb (2.0ms)
> ["/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/haml-2.2.21/lib/haml/
> util.rb:216:in `html_safe'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/haml-2.2.21/lib/haml/
> helpers/xss_mods.rb:118:in `form_for_with_haml_xss'",
>  "/Users/daniel/km/sio/trunk/app/views/users/edit.html.erb:10:in
> `_render_template_603321693_2166771908_0'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_view/template.rb:40:in `render'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_view/render/rendering.rb:101:in `block in
> _render_template'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/
> activesupport-3.0.0.beta/lib/active_support/notifications/
> instrumenter.rb:18:in `instrument'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/
> activesupport-3.0.0.beta/lib/active_support/notifications.rb:49:in
> `instrument'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_view/render/rendering.rb:98:in `_render_template'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_view/render/rendering.rb:92:in `render_template'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/abstract_controller/rendering.rb:84:in `_render_template'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/abstract_controller/rendering.rb:65:in `render_to_body'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/abstract_controller/layouts.rb:308:in `render_to_body'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_controller/metal/rendering.rb:28:in `render_to_body'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_controller/metal/renderers.rb:46:in `render_to_body'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_controller/metal/compatibility.rb:113:in `render_to_body'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/abstract_controller/rendering.rb:49:in `render'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_controller/metal/rendering.rb:21:in `render'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/abstract_controller/localized_cache.rb:39:in `render'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_controller/metal/instrumentation.rb:39:in `block (2 levels)
> in render'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/
> activesupport-3.0.0.beta/lib/active_support/core_ext/benchmark.rb:
> 17:in `block in ms'",
>  "/Users/daniel/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/
> benchmark.rb:309:in `realtime'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/
> activesupport-3.0.0.beta/lib/active_support/core_ext/benchmark.rb:
> 17:in `ms'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_controller/metal/instrumentation.rb:39:in `block in
> render'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_controller/metal/instrumentation.rb:77:in
> `cleanup_view_runtime'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-3.0.0.beta/
> lib/active_record/railties/controller_runtime.rb:15:in
> `cleanup_view_runtime'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_controller/metal/instrumentation.rb:38:in `render'",
>  "/Users/daniel/km/sio/trunk/app/controllers/users_controller.rb:48:in
> `show'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_controller/base.rb:44:in `send'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_controller/base.rb:44:in `send_action'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/abstract_controller/base.rb:145:in `process_action'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/abstract_controller/callbacks.rb:18:in `block in process_action'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/
> activesupport-3.0.0.beta/lib/active_support/callbacks.rb:438:in
> `_run__1446808593__process_action__66377272__callbacks'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/
> activesupport-3.0.0.beta/lib/active_support/callbacks.rb:423:in
> `_run_process_action_callbacks'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/
> activesupport-3.0.0.beta/lib/active_support/callbacks.rb:88:in
> `run_callbacks'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/abstract_controller/callbacks.rb:17:in `process_action'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_controller/metal/rendering.rb:12:in `process_action'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_controller/metal/compatibility.rb:66:in `process_action'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_controller/metal/instrumentation.rb:29:in `block in
> process_action'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/
> activesupport-3.0.0.beta/lib/active_support/notifications/
> instrumenter.rb:18:in `instrument'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/
> activesupport-3.0.0.beta/lib/active_support/notifications.rb:49:in
> `instrument'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_controller/metal/instrumentation.rb:28:in
> `process_action'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_controller/metal/rescue.rb:8:in `process_action'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/abstract_controller/base.rb:115:in `process'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_controller/metal.rb:64:in `dispatch'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_controller/metal/rack_delegation.rb:19:in `dispatch'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_controller/metal.rb:89:in `call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_dispatch/routing/route_set.rb:27:in `call'",
>  "/Users/daniel/km/sio/trunk/vendor/bundle/gems/rack-mount-0.4.7/lib/
> rack/mount/recognition/route_set.rb:70:in `block in call'",
>  "/Users/daniel/km/sio/trunk/vendor/bundle/gems/rack-mount-0.4.7/lib/
> rack/mount/recognition/code_generation.rb:97:in `block in recognize'",
>  "/Users/daniel/km/sio/trunk/vendor/bundle/gems/rack-mount-0.4.7/lib/
> rack/mount/recognition/code_generation.rb:73:in `optimized_each'",
>  "/Users/daniel/km/sio/trunk/vendor/bundle/gems/rack-mount-0.4.7/lib/
> rack/mount/recognition/code_generation.rb:96:in `recognize'",
>  "/Users/daniel/km/sio/trunk/vendor/bundle/gems/rack-mount-0.4.7/lib/
> rack/mount/recognition/route_set.rb:65:in `call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_dispatch/routing/route_set.rb:419:in `call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-3.0.0.beta/
> lib/active_record/query_cache.rb:29:in `block in call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-3.0.0.beta/
> lib/active_record/connection_adapters/abstract/query_cache.rb:34:in
> `cache'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-3.0.0.beta/
> lib/active_record/query_cache.rb:9:in `cache'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-3.0.0.beta/
> lib/active_record/query_cache.rb:28:in `call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-3.0.0.beta/
> lib/active_record/connection_adapters/abstract/connection_pool.rb:
> 365:in `call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_dispatch/middleware/head.rb:14:in `call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.1.0/lib/rack/
> methodoverride.rb:24:in `call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_dispatch/middleware/params_parser.rb:20:in `call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_dispatch/middleware/flash.rb:167:in `call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_dispatch/middleware/session/cookie_store.rb:107:in `call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_dispatch/middleware/cookies.rb:205:in `call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/
> activesupport-3.0.0.beta/lib/active_support/callbacks.rb:429:in
> `_run_call_callbacks'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/
> activesupport-3.0.0.beta/lib/active_support/callbacks.rb:88:in
> `run_callbacks'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_dispatch/middleware/callbacks.rb:44:in `call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_dispatch/middleware/show_exceptions.rb:62:in `call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/railties-3.0.0.beta/lib/
> rails/rack/logger.rb:13:in `call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.1.0/lib/rack/
> runtime.rb:17:in `call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.1.0/lib/rack/
> lock.rb:11:in `block in call'",
>  "<internal:prelude>:8:in `synchronize'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.1.0/lib/rack/
> lock.rb:11:in `call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta/
> lib/action_dispatch/middleware/static.rb:30:in `call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/railties-3.0.0.beta/lib/
> rails/application.rb:95:in `call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/railties-3.0.0.beta/lib/
> rails/application.rb:41:in `method_missing'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/railties-3.0.0.beta/lib/
> rails/rack/log_tailer.rb:15:in `call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.1.0/lib/rack/
> content_length.rb:13:in `call'",
>  "/Users/daniel/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.1.0/lib/rack/
> handler/webrick.rb:48:in `service'",
>  "/Users/daniel/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/webrick/
> httpserver.rb:111:in `service'",
>  "/Users/daniel/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/webrick/
> httpserver.rb:70:in `run'",
>  "/Users/daniel/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/webrick/
> server.rb:183:in `block in start_thread'"]
>
> --
> You received this message because you are subscribed to the Google Groups
> "Haml" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected] <haml%[email protected]>.
> For more options, visit this group at
> http://groups.google.com/group/haml?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/haml?hl=en.

Reply via email to