jm / rails_upgrade

Plugin to run checks on your Rails 2.x/3.x to check for obvious upgrade points on the path to 3.0
http://omgbloglol.com
MIT License
68 stars 74 forks source link

error generating routes with map.root #6

Open tardate opened 14 years ago

tardate commented 14 years ago

Testing a migration on a very small/simple 2.3.5 site, rake rails:upgrade:routes fails with map.root in the routes file, e.g.

map.root :articles

Commenting this out, routes generation is ok.

$ rake rails:upgrade:routes --trace (in /Users/paulgallagher/MyGithub/heroku/rails-authlogic-rpx-sample) * Invoke rails:upgrade:routes (first_time) * Execute rails:upgrade:routes rake aborted! undefined method []' for :articles:Symbol /Users/paulgallagher/MyGithub/heroku/rails-authlogic-rpx-sample/vendor/plugins/rails_upgrade/lib/tasks/../../lib/routes_upgrader.rb:237:into_route_code' /Users/paulgallagher/MyGithub/heroku/rails-authlogic-rpx-sample/vendor/plugins/rails_upgrade/lib/tasks/../../lib/routes_upgrader.rb:337:in generate' /Users/paulgallagher/MyGithub/heroku/rails-authlogic-rpx-sample/vendor/plugins/rails_upgrade/lib/tasks/../../lib/routes_upgrader.rb:336:inmap' /Users/paulgallagher/MyGithub/heroku/rails-authlogic-rpx-sample/vendor/plugins/rails_upgrade/lib/tasks/../../lib/routes_upgrader.rb:336:in generate' /Users/paulgallagher/MyGithub/heroku/rails-authlogic-rpx-sample/vendor/plugins/rails_upgrade/lib/tasks/../../lib/routes_upgrader.rb:51:inupgrade_routes' /Users/paulgallagher/MyGithub/heroku/rails-authlogic-rpx-sample/vendor/plugins/rails_upgrade/lib/tasks/../../lib/routes_upgrader.rb:28:in generate_new_routes' /Users/paulgallagher/MyGithub/heroku/rails-authlogic-rpx-sample/vendor/plugins/rails_upgrade/lib/tasks/rails_upgrade_tasks.rake:28 /Users/paulgallagher/.rvm/gems/ruby-1.8.7-p302@rails235/gems/rake-0.8.7/lib/rake.rb:636:incall' /Users/paulgallagher/.rvm/gems/ruby-1.8.7-p302@rails235/gems/rake-0.8.7/lib/rake.rb:636:in execute' /Users/paulgallagher/.rvm/gems/ruby-1.8.7-p302@rails235/gems/rake-0.8.7/lib/rake.rb:631:ineach' /Users/paulgallagher/.rvm/gems/ruby-1.8.7-p302@rails235/gems/rake-0.8.7/lib/rake.rb:631:in execute' /Users/paulgallagher/.rvm/gems/ruby-1.8.7-p302@rails235/gems/rake-0.8.7/lib/rake.rb:597:ininvoke_with_call_chain' /Users/paulgallagher/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/monitor.rb:242:in synchronize' /Users/paulgallagher/.rvm/gems/ruby-1.8.7-p302@rails235/gems/rake-0.8.7/lib/rake.rb:590:ininvoke_with_call_chain' /Users/paulgallagher/.rvm/gems/ruby-1.8.7-p302@rails235/gems/rake-0.8.7/lib/rake.rb:583:in invoke' /Users/paulgallagher/.rvm/gems/ruby-1.8.7-p302@rails235/gems/rake-0.8.7/lib/rake.rb:2051:ininvoke_task' /Users/paulgallagher/.rvm/gems/ruby-1.8.7-p302@rails235/gems/rake-0.8.7/lib/rake.rb:2029:in top_level' /Users/paulgallagher/.rvm/gems/ruby-1.8.7-p302@rails235/gems/rake-0.8.7/lib/rake.rb:2029:ineach' /Users/paulgallagher/.rvm/gems/ruby-1.8.7-p302@rails235/gems/rake-0.8.7/lib/rake.rb:2029:in top_level' /Users/paulgallagher/.rvm/gems/ruby-1.8.7-p302@rails235/gems/rake-0.8.7/lib/rake.rb:2068:instandard_exception_handling' /Users/paulgallagher/.rvm/gems/ruby-1.8.7-p302@rails235/gems/rake-0.8.7/lib/rake.rb:2023:in top_level' /Users/paulgallagher/.rvm/gems/ruby-1.8.7-p302@rails235/gems/rake-0.8.7/lib/rake.rb:2001:inrun' /Users/paulgallagher/.rvm/gems/ruby-1.8.7-p302@rails235/gems/rake-0.8.7/lib/rake.rb:2068:in standard_exception_handling' /Users/paulgallagher/.rvm/gems/ruby-1.8.7-p302@rails235/gems/rake-0.8.7/lib/rake.rb:1998:inrun' /Users/paulgallagher/.rvm/gems/ruby-1.8.7-p302@rails235/gems/rake-0.8.7/bin/rake:31 /Users/paulgallagher/.rvm/gems/ruby-1.8.7-p302@rails235/bin/rake:19:in `load' /Users/paulgallagher/.rvm/gems/ruby-1.8.7-p302@rails235/bin/rake:19

Maay commented 13 years ago

Having the same problem.

knappe commented 12 years ago

I am too when using:

map.root :homepage