Folks,
Excuse me if this is obvious. I have done a google but haven''t found
anything.
I''m just going through the Ruby on Rails book and installed the
software
from the SVN server as it mentioned that a lot of things in the book
won''t
work with the current stable release.
I started with the Depot example and ran:
>ruby scriptgenerate scaffold Product Admin
./script/../config/..//vendor/rails/actionpack/lib/action_controller/code_ge
nera
tion.rb:69:in `dup'': allocator undefined for Proc (NoMethodError)
from
./script/../config/..//vendor/rails/actionpack/lib/action_controlle
r/code_generation.rb:69:in `dup''
from
./script/../config/..//vendor/rails/actionpack/lib/action_controlle
r/code_generation.rb:66:in `each''
from
./script/../config/..//vendor/rails/actionpack/lib/action_controlle
r/code_generation.rb:66:in `dup''
from
./script/../config/..//vendor/rails/actionpack/lib/action_controlle
r/code_generation.rb:46:in `method_missing''
from
./script/../config/..//vendor/rails/actionpack/lib/action_controlle
r/code_generation.rb:46:in `indent''
from
./script/../config/..//vendor/rails/actionpack/lib/action_controlle
r/code_generation.rb:46:in `method_missing''
from
./script/../config/..//vendor/rails/actionpack/lib/action_controlle
r/routing.rb:444:in `write_recognition''
from
./script/../config/..//vendor/rails/actionpack/lib/action_controlle
r/routing.rb:546:in `draw''
from ./script/../config/../config/routes.rb:1
from
./script/../config/..//vendor/rails/activesupport/lib/active_suppor
t/dependencies.rb:193:in `load''
from
./script/../config/..//vendor/rails/activesupport/lib/active_suppor
t/dependencies.rb:193:in `load''
from
./script/../config/..//vendor/rails/actionpack/lib/action_controlle
r/routing.rb:523:in `reload''
from ./script/../config/environment.rb:64
from script/generate:2:in `require''
from script/generate:2
I poked around and change line 68
actionpack/lib/action_controller/code_generation.rb from:
value = value.dup unless value.nil? || value.is_a?(Numeric)
to:
value = value.dup unless value.nil? || value.is_a?(Numeric) ||
value.is_a?(Proc)
And now it runs through. However, I do not expect such an obvious thing to
have stayed undetected, so I assume there is something else wrong. Any
ideas?
Thanks,
-max