#607 ✓invalid
averell23

routing prevents database migration

Reported by averell23 | January 19th, 2010 @ 04:52 PM

It seems that the automatic routing prevents the re-migration of the databases from scratch.

Here's what I did:

  • Created the "Agility" application from the Tutorial
  • Dropped the database
  • Created an empty database
  • Tried to rake db:migrate

Result:

Crash. See the included stack trace, it seems that the routing will try to load stuff and find that the users table doesn't exist.

The migrations work fine with an empty routes.rb

agility daniel$ rake db:migrate --trace
(in /Developer/FunProjects/agility)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
Table users does not exist
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/query_cache.rb:70:in `columns_with_query_cache'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1271:in `columns'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/hobo-0.9.103/lib/hobo/model.rb:145
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/hobosupport-0.9.103/lib/hobo_support/module.rb:31:in `call'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/hobosupport-0.9.103/lib/hobo_support/module.rb:31:in `name_attribute'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/hobo-0.9.103/lib/hobo/model_controller.rb:92:in `autocomplete'
/Developer/FunProjects/agility/app/controllers/users_controller.rb:7
/Developer/FunProjects/agility/app/controllers/users_controller.rb:380:in `load'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:380:in `load_file'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:379:in `load_file'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:259:in `require_or_load'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:425:in `load_missing_constant'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing_with_dependencies'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in `const_missing'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:361:in `constantize'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in `each'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in `constantize'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/string/inflections.rb:162:in `constantize'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/hobo-0.9.103/lib/hobo/model_controller.rb:61:in `all_controllers'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/hobo-0.9.103/lib/hobo/model_controller.rb:57:in `each'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/hobo-0.9.103/lib/hobo/model_controller.rb:57:in `all_controllers'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/hobo-0.9.103/lib/hobo/model_router.rb:97:in `add_routes_for'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/hobo-0.9.103/lib/hobo/model_router.rb:83:in `add_routes'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/hobo-0.9.103/lib/hobo/model_router.rb:83:in `each'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/hobo-0.9.103/lib/hobo/model_router.rb:83:in `add_routes'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/hobo-0.9.103/lib/hobo.rb:73:in `add_routes'
/Developer/FunProjects/agility/config/routes.rb:6
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:226:in `draw'
/Developer/FunProjects/agility/config/routes.rb:1
/Developer/FunProjects/agility/config/routes.rb:145:in `load'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in `load_with_new_constant_marking'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in `load_with_new_constant_marking'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:286:in `load_routes!'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:286:in `each'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:286:in `load_routes!'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:266:in `load!'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:537:in `initialize_routing'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:188:in `process'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `run'
/Developer/FunProjects/agility/config/environment.rb:9
/Developer/FunProjects/agility/config/environment.rb:31:in `require'
/Developer/Talia/jruby-1.4.0/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/misc.rake:4
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/Developer/Talia/jruby-1.4.0/lib/ruby/1.8/monitor.rb:242:in `mon_synchronize'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/Developer/Talia/jruby-1.4.0/lib/ruby/1.8/monitor.rb:242:in `mon_synchronize'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/Developer/Talia/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:19:in `load'
/Developer/Talia/jruby-1.4.0/bin/rake:19

Comments and changes to this ticket

  • Bryan Larsen

    Bryan Larsen January 19th, 2010 @ 05:42 PM

    This is an activity that I perform regularly without any problems.

    Are you using http://github.com/bryanlarsen/agility-gitorial unmodified? If not, what changes did you make?

    did you use rake db:drop and rake db:create to drop and create respectively.

  • averell23

    averell23 January 19th, 2010 @ 06:04 PM

    • I've not used db:create/db:drop. I had to reinstall mysql, so I simply created an empty database from mysql
    • I didn't use the project unmodified (I actually "developed" it myself). I've attached a diff.
    • Platform is jruby 1.4.0 on MacOS X 10.6
  • Bryan Larsen

    Bryan Larsen January 19th, 2010 @ 06:52 PM

    • State changed from “new” to “invalid”

    ah, you're using the jdbcmysql adapter. Now I'm no longer surprised. try rake db:setup instead of db:migrate. I'm going to mark this as invalid since I think it's a rails/jruby issue not a hobo bug, but If you keep posting here I can keep trying to help.

  • averell23

    averell23 January 19th, 2010 @ 06:57 PM

    Well, the connection to jdbc wasn't quite obvious to me. In any case, I worked around it by having and empty route.rb during the migration - just wanted to let you know. Unfortunately I haven't got the time at the moment to investigate it myself.

    Thanks for the help :)

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Attachments

Pages