I very consistently got this error, and could not at first figure out why it occured.
Showing usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/templates/scaffolds/list.rhtml where line #13 raised wrong number of arguments
10: <% for entry in instance_variable_get("@#{@scaffold_plural_name}") %>
11: <tr>
12: <% for column in @scaffold_class.content_columns %>
13: <td><%= entry.send(column.name) %></td>
14: <% end %>
15: <td><%= link_to "Show", :action => "show#{@scaffold_suffix}", :id => entry.id %></td>
16: <td><%= link_to "Edit", :action => "edit#{@scaffold_suffix}", :id => entry.id %></td>
Template Trace Top
(erb):13:in `system'
(erb):13:in `send'
(erb):13:in `evaluate_locals'
The spurious call to system was the key. The database in use had a column labeled 'system', and the Kernel#system was being called via the send call. I verified that using any of the following names in a database with scaffolding causes errors/malfunctions/misrenderings like this:
abort, atExit, autoload, binding, callcc, caller, catch, chomp, chop, eval, exec, exit, fail, fork, format, gets, globalVariables, gsub, lambda, load, localVariables, loop, open, p, print, printf, proc, putc, puts, raise, rand, readline, readlines, require, scan, select, setTraceFunc, singletonMethodAdded, sleep, split, sprintf, srand, sub, syscall, system, test, throw, traceVar, trap, untraceVar
It's likely that all the methods in Object, Module, and definitely anything dynamically 'include'd into Object will fall under this bug.
The worst case being a column called 'sleep', which puts the webserver to sleep forever. Other bad cases include rand, which generates a mysterious 1 or 0 in the output without other error; all io calls that don't have to have arguments either block, or generate randomish data; and fail, raise, exit which generate errors which have nothing to do with the actual error.
I'm sure that this interferes with other reflection/introspection performed in ActiveRecord, but right now do not have specific other problems.