I''m trying to add an RSS feed to my small Rails app, and was trying to get going by following the example in the ActionPack rdoc. After substituting the right variable names, I''m getting this, which I don''t believe is related to my template: Rendering rss/index (200 OK) ActionView::TemplateError (/usr/local/lib/ruby/1.8/fileutils.rb:736:in `directory?'': cannot convert Hash into String) on line #1 of /rss/index.rxml: 1: xml.rss("version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/") do 2: xml.channel do 3: xml.title(@feed_title) 4: xml.link(@url) /gems/actionpack-0.9.0/lib/action_view/base.rb:248:in `eval'' /usr/local/lib/ruby/1.8/fileutils.rb:736:in `fu_each_src_dest0'' /usr/local/lib/ruby/1.8/fileutils.rb:244:in `link'' /gems/rake-0.4.8/lib/rake.rb:437:in `link'' (eval):4:in `render_template'' (eval):2:in `call'' /gems/actionpack-0.9.0/lib/action_view/vendor/builder/xmlbase.rb:138:in `_nested_structures'' /gems/actionpack-0.9.0/lib/action_view/vendor/builder/xmlbase.rb:60:in `method_missing'' (eval):2:in `render_template'' (eval):1:in `call'' /gems/actionpack-0.9.0/lib/action_view/vendor/builder/xmlbase.rb:138:in `_nested_structures'' /gems/actionpack-0.9.0/lib/action_view/vendor/builder/xmlbase.rb:60:in `method_missing'' (eval):1:in `render_template'' /gems/actionpack-0.9.0/lib/action_view/base.rb:191:in `render_template'' /gems/actionpack-0.9.0/lib/action_view/base.rb:166:in `render_file'' /gems/actionpack-0.9.0/lib/action_controller/base.rb:357:in `render_file'' /gems/actionpack-0.9.0/lib/action_controller/base.rb:339:in `render_without_layout'' /gems/actionpack-0.9.0/lib/action_controller/layout.rb:139:in `render_without_benchmark'' /gems/actionpack-0.9.0/lib/action_controller/benchmarking.rb:22:in `render'' /gems/actionpack-0.9.0/lib/action_controller/benchmarking.rb:22:in `measure'' /gems/actionpack-0.9.0/lib/action_controller/benchmarking.rb:22:in `render'' /gems/actionpack-0.9.0/lib/action_controller/base.rb:564:in `perform_action_without_filters'' /gems/actionpack-0.9.0/lib/action_controller/filters.rb:236:in `perform_action_without_benchmark'' /gems/actionpack-0.9.0/lib/action_controller/benchmarking.rb:30:in `perform_action_without_rescue'' /gems/actionpack-0.9.0/lib/action_controller/benchmarking.rb:30:in `measure'' /gems/actionpack-0.9.0/lib/action_controller/benchmarking.rb:30:in `perform_action_without_rescue'' /gems/actionpack-0.9.0/lib/action_controller/rescue.rb:68:in `perform_action'' /gems/actionpack-0.9.0/lib/action_controller/base.rb:254:in `process'' /gems/actionpack-0.9.0/lib/action_controller/base.rb:235:in `process'' /gems/rails-0.8.0/lib/dispatcher.rb:35:in `dispatch'' /Users/stmpjmpr/Sites/rails/public/dispatch.cgi:8 Any ideas to point me in the right direction? --Scott
On Nov 1, 2004, at 12:39, Scott Hill wrote:> I''m trying to add an RSS feed to my small Rails app, and was trying to > get going by following the example in the ActionPack rdoc. After > substituting the right variable names, I''m getting this, which I don''t > believe is related to my template:<snip>> Any ideas to point me in the right direction?I just dealt with this... it turns out to be a bad combination of rubygems, rake, builder and rails. To fix, upgrade rake to 0.4.9. Basically, gems can auto-require dependencies, meaning rake (prior to 0.4.9, which disables auto-require) is required when running rails. Now, this doesn''t normally cause a problem, except in builder, which uses a stripped down object to work its magic. When rake is required, it includes methods at the top-level, and this happens _after_ the builder object is stripped down. One of the methods that happens to be included by rake is link (as in symlink), which is then called instead of method_missing on the builder object. Thus the weird error message. HTH, Nathaniel Terralien, Inc. <:((>< _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Nathaniel Talbott said:> On Nov 1, 2004, at 12:39, Scott Hill wrote: > >> I''m trying to add an RSS feed to my small Rails app, and was trying to >> get going by following the example in the ActionPack rdoc. After >> substituting the right variable names, I''m getting this, which I don''t >> believe is related to my template: > > <snip> > >> Any ideas to point me in the right direction? > > I just dealt with this... it turns out to be a bad combination of > rubygems, rake, builder and rails. To fix, upgrade rake to 0.4.9. > > Basically, gems can auto-require dependencies, meaning rake (prior to > 0.4.9, which disables auto-require) is required when running rails. > Now, this doesn''t normally cause a problem, except in builder, which > uses a stripped down object to work its magic. When rake is required, > it includes methods at the top-level, and this happens _after_ the > builder object is stripped down. One of the methods that happens to be > included by rake is link (as in symlink), which is then called instead > of method_missing on the builder object. Thus the weird error message.You can also upgrade to Builder 1.2.1 which uses the "method_added" hook to prevent late method additions to Kernel and Object from polluting the BlankSlate class (upon which Builder is based). -- -- Jim Weirich jim-Fxty1mrVU9GlFc2d6oM/ew@public.gmane.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)