Open TylerRick opened 14 years ago
It looks like the problem is that the lambda in vendor/plugins/routing-filter/lib/routing_filter/base.rb is not defined with any parameters but it is called with 2.
Unlike Ruby 1.8, 1.9 actually enforces the arity of procs created with lambda
:
RUBY_VERSION = 1.9.1 > proc = lambda {}; proc.call(1,2) ArgumentError: wrong number of arguments (2 for 0) from (irb):2:in `call' RUBY_VERSION = 1.8.7 > proc = lambda {}; proc.call(1,2) => nil
Changing it to a proc fixed it for me:
diff --git a/engines/adva_cms/vendor/plugins/routing-filter/lib/routing_filter/base.rb b/engines/adva_cms/vendor/plugins/routing-filter/lib/routing_filter/base.rb index 73964ad..c8d2c80 100644 --- a/engines/adva_cms/vendor/plugins/routing-filter/lib/routing_filter/base.rb +++ b/engines/adva_cms/vendor/plugins/routing-filter/lib/routing_filter/base.rb @@ -11,8 +11,8 @@ module RoutingFilter end def run(method, *args, &block) - successor = @successor ? lambda { @successor.run(method, *args, &block) } : block + successor = @successor ? proc {|path, env| @successor.run(method, *args, &block) } : block active ? send(method, *args, &successor) : successor.call(*args) end end -end \ No newline at end of file +end
(procs created with Kernel#proc aren't subject to the arity check that those created with Kernel#lambda are. And if we simply add the 2 parameters, I got this opposite error instead: wrong number of arguments (0 for 2))
I've fixed this and to other Ruby 1.9 issues in my fork. Please pull from git://github.com/TylerRick/adva_cms.git
When I go to http://localhost:3002/, I get this error:
I don't get that error when I change script/server to use ruby1.8:
(But that is not an option for me.)