Especially since it's not working in script/console, I'm guessing this isn't a Haml bug. Have you tried asking the Rails list?
On Sun, Jan 24, 2010 at 11:06 AM, jollyroger <[email protected]>wrote: > Hey guys, > > I got a serious problem with haml. I have used haml in several > projects, so I am no newbie to haml - however I never had an error > like this: > > The problem: > > Something like this: > > #welcome > #show > #create_ideas_area > %p > = link_to 'Create an idea', new_idea_path, :id => > 'create_idea_link' > > causes: > > ActionView::TemplateError (undefined method `link_to' for > #<ActionView::Base:0xb61dad24>) on line #5 of app/views/welcomes/ > show.haml: > 2: > #show > 3: > #create_ideas_area > 4: > %p > 5: = link_to 'Create an idea', new_idea_path, :id => > 'create_idea_link' > > app/views/welcomes/show.haml:5:in > `_run_haml_app47views47welcomes47show46haml' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_view/ > renderable.rb:34:in `send' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_view/ > renderable.rb:34:in `render' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_view/base.rb: > 306:in `with_template' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_view/ > renderable.rb:30:in `render' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_view/ > template.rb:205:in `render_template' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_view/base.rb: > 265:in `render_without_haml' > vendor/bundler_gems/gems/haml-2.2.17/lib/haml/helpers/ > action_view_mods.rb:13:in `render' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > base.rb:1250:in `render_for_file' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > base.rb:951:in `render_without_benchmark' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > benchmarking.rb:51:in `render' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > benchmarking.rb:51:in `render' > app/controllers/welcomes_controller.rb:6:in > `show' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > base.rb:1331:in `send' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > base.rb:1331:in `perform_action_without_filters' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > filters.rb:617:in `call_filters' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > filters.rb:610:in `perform_action_without_benchmark' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > benchmarking.rb:68:in `perform_action_without_rescue' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > benchmarking.rb:68:in `perform_action_without_rescue' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > rescue.rb:160:in `perform_action_without_flash' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > flash.rb:146:in `perform_action' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > base.rb:532:in `send' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > base.rb:532:in `process_without_filters' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > filters.rb:606:in `sass_old_process' > vendor/bundler_gems/gems/haml-2.2.17/rails/./lib/sass/plugin/ > rails.rb:19:in `process' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > base.rb:391:in `process' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > base.rb:386:in `call' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > routing/route_set.rb:437:in `call' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > dispatcher.rb:87:in `dispatch' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > dispatcher.rb:121:in `_call' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > dispatcher.rb:130:in `build_middleware_stack' > vendor/bundler_gems/gems/activerecord-2.3.5/lib/active_record/ > query_cache.rb:29:in `call' > vendor/bundler_gems/gems/activerecord-2.3.5/lib/active_record/ > query_cache.rb:29:in `call' > vendor/bundler_gems/gems/activerecord-2.3.5/lib/active_record/ > connection_adapters/abstract/query_cache.rb:34:in `cache' > vendor/bundler_gems/gems/activerecord-2.3.5/lib/active_record/ > query_cache.rb:9:in `cache' > vendor/bundler_gems/gems/activerecord-2.3.5/lib/active_record/ > query_cache.rb:28:in `call' > vendor/bundler_gems/gems/activerecord-2.3.5/lib/active_record/ > connection_adapters/abstract/connection_pool.rb:361:in `call' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > string_coercion.rb:25:in `call' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > params_parser.rb:15:in `call' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > session/cookie_store.rb:93:in `call' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > failsafe.rb:26:in `call' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > dispatcher.rb:114:in `call' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > reloader.rb:34:in `run' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > dispatcher.rb:108:in `call' > passenger (2.2.8) lib/phusion_passenger/rack/request_handler.rb: > 92:in `process_request' > passenger (2.2.8) lib/phusion_passenger/ > abstract_request_handler.rb:207:in > `main_loop' > passenger (2.2.8) lib/phusion_passenger/railz/ > application_spawner.rb:385:in > `start_request_handler' > passenger (2.2.8) lib/phusion_passenger/railz/ > application_spawner.rb:343:in > `handle_spawn_application' > passenger (2.2.8) lib/phusion_passenger/utils.rb:184:in > `safe_fork' > passenger (2.2.8) lib/phusion_passenger/railz/ > application_spawner.rb:341:in > `handle_spawn_application' > passenger (2.2.8) lib/phusion_passenger/abstract_server.rb:352:in > `__send__' > passenger (2.2.8) lib/phusion_passenger/abstract_server.rb:352:in > `main_loop' > passenger (2.2.8) lib/phusion_passenger/abstract_server.rb:196:in > `start_synchronously' > passenger (2.2.8) lib/phusion_passenger/abstract_server.rb:163:in > `start' > passenger (2.2.8) lib/phusion_passenger/railz/ > application_spawner.rb:209:in > `start' > passenger (2.2.8) lib/phusion_passenger/spawn_manager.rb:262:in > `spawn_rails_application' > passenger (2.2.8) lib/phusion_passenger/ > abstract_server_collection.rb:126:in > `lookup_or_add' > passenger (2.2.8) lib/phusion_passenger/spawn_manager.rb:256:in > `spawn_rails_application' > passenger (2.2.8) lib/phusion_passenger/ > abstract_server_collection.rb:80:in > `synchronize' > passenger (2.2.8) lib/phusion_passenger/ > abstract_server_collection.rb:79:in > `synchronize' > passenger (2.2.8) lib/phusion_passenger/spawn_manager.rb:255:in > `spawn_rails_application' > passenger (2.2.8) lib/phusion_passenger/spawn_manager.rb:154:in > `spawn_application' > passenger (2.2.8) lib/phusion_passenger/spawn_manager.rb:287:in > `handle_spawn_application' > passenger (2.2.8) lib/phusion_passenger/abstract_server.rb:352:in > `__send__' > passenger (2.2.8) lib/phusion_passenger/abstract_server.rb:352:in > `main_loop' > passenger (2.2.8) lib/phusion_passenger/abstract_server.rb:196:in > `start_synchronously' > > Rendered rescues/_trace (49.6ms) > > > Processing ApplicationController#show (for 127.0.0.1 at 2010-01-24 > 17:21:48) [GET] > Parameters: {"action"=>"show", > "controller"=>"welcomes"} > > ActionView::TemplateError (undefined method `debug' for > #<ActionView::Base:0xb61dad24>) on line #20 of vendor/bundler_gems/ > gems/actionpack-2.3.5/lib/action_controller/templates/rescues/ > _request_and_response.erb: > 17: <p><b>Parameters</b>: <pre><%=h request_dump %></pre></ > p> > 18: > 19: <p><a href="#" onclick="document.getElementById > ('session_dump').style.display='block'; return false;">Show session > dump</a></p> > 20: <div id="session_dump" style="display:none"><%= debug > (request.session.instance_variable_get("@data")) %></ > div> > 21: > 22: > 23: <h2 style="margin-top: 30px">Response</ > h2> > > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > templates/rescues/_request_and_response.erb:20 > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_view/ > renderable.rb:34:in `send' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_view/ > renderable.rb:34:in `render' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_view/base.rb: > 306:in `with_template' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_view/ > renderable.rb:30:in `render' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_view/ > renderable_partial.rb:20:in `render' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > benchmarking.rb:26:in `benchmark' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > benchmarking.rb:26:in `benchmark' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_view/ > renderable_partial.rb:19:in `render' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_view/ > template.rb:205:in `render_template' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_view/base.rb: > 265:in `render_without_haml' > vendor/bundler_gems/gems/haml-2.2.17/lib/haml/helpers/ > action_view_mods.rb:13:in `render' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > templates/rescues/template_error.erb:21 > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_view/ > renderable.rb:34:in `send' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_view/ > renderable.rb:34:in `render' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_view/base.rb: > 306:in `with_template' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_view/ > renderable.rb:30:in `render' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_view/ > template.rb:205:in `render_template' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_view/base.rb: > 265:in `render_without_haml' > vendor/bundler_gems/gems/haml-2.2.17/lib/haml/helpers/ > action_view_mods.rb:13:in `render' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > rescue.rb:134:in `rescue_action_locally' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > rescue.rb:152:in `rescue_action_without_handler' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > rescue.rb:74:in `rescue_action' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > rescue.rb:162:in `perform_action_without_flash' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > flash.rb:146:in `perform_action' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > base.rb:532:in `send' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > base.rb:532:in `process_without_filters' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > filters.rb:606:in `sass_old_process' > vendor/bundler_gems/gems/haml-2.2.17/rails/./lib/sass/plugin/ > rails.rb:19:in `process' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > base.rb:391:in `process' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > base.rb:386:in `call' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > routing/route_set.rb:437:in `call' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > dispatcher.rb:87:in `dispatch' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > dispatcher.rb:121:in `_call' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > dispatcher.rb:130:in `build_middleware_stack' > vendor/bundler_gems/gems/activerecord-2.3.5/lib/active_record/ > query_cache.rb:29:in `call' > vendor/bundler_gems/gems/activerecord-2.3.5/lib/active_record/ > query_cache.rb:29:in `call' > vendor/bundler_gems/gems/activerecord-2.3.5/lib/active_record/ > connection_adapters/abstract/query_cache.rb:34:in `cache' > vendor/bundler_gems/gems/activerecord-2.3.5/lib/active_record/ > query_cache.rb:9:in `cache' > vendor/bundler_gems/gems/activerecord-2.3.5/lib/active_record/ > query_cache.rb:28:in `call' > vendor/bundler_gems/gems/activerecord-2.3.5/lib/active_record/ > connection_adapters/abstract/connection_pool.rb:361:in `call' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > string_coercion.rb:25:in `call' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > params_parser.rb:15:in `call' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > session/cookie_store.rb:93:in `call' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > failsafe.rb:26:in `call' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > dispatcher.rb:114:in `call' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > reloader.rb:34:in `run' > vendor/bundler_gems/gems/actionpack-2.3.5/lib/action_controller/ > dispatcher.rb:108:in `call' > passenger (2.2.8) lib/phusion_passenger/rack/request_handler.rb: > 92:in `process_request' > passenger (2.2.8) lib/phusion_passenger/ > abstract_request_handler.rb:207:in > `main_loop' > passenger (2.2.8) lib/phusion_passenger/railz/ > application_spawner.rb:385:in > `start_request_handler' > passenger (2.2.8) lib/phusion_passenger/railz/ > application_spawner.rb:343:in > `handle_spawn_application' > passenger (2.2.8) lib/phusion_passenger/utils.rb:184:in > `safe_fork' > passenger (2.2.8) lib/phusion_passenger/railz/ > application_spawner.rb:341:in > `handle_spawn_application' > passenger (2.2.8) lib/phusion_passenger/abstract_server.rb:352:in > `__send__' > passenger (2.2.8) lib/phusion_passenger/abstract_server.rb:352:in > `main_loop' > passenger (2.2.8) lib/phusion_passenger/abstract_server.rb:196:in > `start_synchronously' > passenger (2.2.8) lib/phusion_passenger/abstract_server.rb:163:in > `start' > passenger (2.2.8) lib/phusion_passenger/railz/ > application_spawner.rb:209:in > `start' > passenger (2.2.8) lib/phusion_passenger/spawn_manager.rb:262:in > `spawn_rails_application' > passenger (2.2.8) lib/phusion_passenger/ > abstract_server_collection.rb:126:in > `lookup_or_add' > passenger (2.2.8) lib/phusion_passenger/spawn_manager.rb:256:in > `spawn_rails_application' > passenger (2.2.8) lib/phusion_passenger/ > abstract_server_collection.rb:80:in > `synchronize' > passenger (2.2.8) lib/phusion_passenger/ > abstract_server_collection.rb:79:in > `synchronize' > passenger (2.2.8) lib/phusion_passenger/spawn_manager.rb:255:in > `spawn_rails_application' > passenger (2.2.8) lib/phusion_passenger/spawn_manager.rb:154:in > `spawn_application' > passenger (2.2.8) lib/phusion_passenger/spawn_manager.rb:287:in > `handle_spawn_application' > passenger (2.2.8) lib/phusion_passenger/abstract_server.rb:352:in > `__send__' > passenger (2.2.8) lib/phusion_passenger/abstract_server.rb:352:in > `main_loop' > passenger (2.2.8) lib/phusion_passenger/abstract_server.rb:196:in > `start_synchronously' > > > The problem is helper-specific, something like that: > > > #welcome > #show > #create_ideas_area > %p > %a{:href => '#', :title => 'foo'} > > is rendered without errors. > > Note the script/console output in some working project (on the same > machine): > > helper.link_to('foo', '#') > => "<a href=\"#\">foo</a>" > > This doesn't work when i "cd" into the project from above and do a > script/console: > > helper.link_to('foo', '#') > NoMethodError: undefined method `link_to' for #<ActionView::Base: > 0xb6dd3db0> > from (irb):1 > > The haml gem is not installed system-wide because i use gem bundler, > the line in "Gemfile" reads: > > gem "haml" #(which is the same line in all my projects) > > "gem bundle" runs through without any errors. > > Any idea what's going on here? > > How can I debug this further? > > -- > 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.
