Obscure route generation error when migrating Rails 2.3.8 app to Bundler

I’m migrating a very large Rails 2.3.8 application to Bundler and
after moving our gem requirements over am experiencing this error when
starting the server or running rake:

=> Booting Mongrel
=> Rails 2.3.8 application starting on http://0.0.0.0:3000
(DELEGATE):2:in not_found': wrong number of arguments (2 for 0) (ArgumentError) from (__DELEGATE__):2:insend’
from (DELEGATE):2:in not_found' from /app_dir/vendor/rails/activesupport/lib/active_support/ option_merger.rb:20:insend
from /app_dir/vendor/rails/activesupport/lib/active_support/
option_merger.rb:20:in method_missing' from /app_dir/config/routes/plaza_routes.rb:5 from /app_dir/vendor/rails/activesupport/lib/active_support/core_ext/ object/misc.rb:78:inwith_options’
from /app_dir/vendor/rails/actionpack/lib/action_controller/routing/
route_set.rb:51:in `namespace’

No amount of vendorizing/unvendorizing/versioning/etc. has budged this
error, which seems to occur during route drawing. Here’s lines 1-5 of
plaza_routes:

ActionController::Routing::Routes.draw do |map|

Public Routes

map.namespace :global, :path_prefix => ‘plaza’ do |global|
global.home ‘.:format’, :controller => ‘home’, :action => ‘index’
global.not_found ‘/not_found’, :controller => ‘home’, :action =>
‘not_found’

If I do a bundle install on the branch with Bundler, then test our
master branch with the resulting installed gems, everything passes, so
I believe the Gemfile is at least getting the right gems installed,
but something about the way they’re loading is causing routes to
break. The only differences on the branch are the backporting code for
Bundler and the Gemfile, and I’m using RVM to guarantee gem isolation.

Any suggestions or pointers?

So it turns out having a route named not_found, like this:

global.not_found ‘/not_found’, :controller => ‘home’, :action =>
‘not_found’

is EVIL and was the source of this error. Renaming the route and action
solved it. Magic!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs