This project is archived and is in readonly mode.

#4666 ✓invalid
Maneesh

Adding Observer fails initial db:setup

Reported by Maneesh | May 22nd, 2010 @ 04:24 PM

Adding an observer for an active record, starts failing db:setup. Removing the observer makes it work..

Here is the trace
rake aborted!
Mysql::Error: Table 'dev.visibilities' doesn't exist: SELECT * FROM visibilities WHERE (name = 'Public') LIMIT 1
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract_adapter.rb:219:in log'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:323:inexecute'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:608:in select'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/database_statements.rb:7:inselect_all_without_query_cache'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/query_cache.rb:62:in select_all'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:661:infind_by_sql'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1548:in find_every'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1505:infind_initial'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:613:in find'<br/> C:/Development/aptana/myapp/app/models/visibility.rb:2<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:380:inload_without_new_constant_marking'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:380:in load_file'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:innew_constants_in'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:379:in load_file'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:259:inrequire_or_load'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:425:in load_missing_constant'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:inconst_missing'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in const_missing'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:437:inload_missing_constant'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:96:in const_missing'<br/> C:/Development/aptana/myapp/app/models/userprofile.rb:17<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:380:inload_without_new_constant_marking'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:380:in load_file'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:innew_constants_in'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:379:in load_file'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:259:inrequire_or_load'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:425:in load_missing_constant'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:inconst_missing'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in const_missing'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:361:inconstantize'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in each'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:inconstantize'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/string/inflections.rb:162:in constantize'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/observer.rb:149:inobserve'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/observer.rb:149:in collect!'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/observer.rb:149:inobserve'
C:/Development/aptana/myapp/app/controllers/some_observer.rb:2
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:380:in load_without_new_constant_marking'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:380:inload_file'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in new_constants_in'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:379:inload_file'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:259:in require_or_load'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:425:inload_missing_constant'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in const_missing'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:inconst_missing'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:361:in constantize'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:ineach'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in constantize'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/string/inflections.rb:162:inconstantize'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/observer.rb:38:in instantiate_observers'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/observer.rb:36:ineach'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/observer.rb:36:in instantiate_observers'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:15<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:182:incall'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:182:in evaluate_method'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:166:incall'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:90:in run'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:90:ineach'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:90:in send'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:90:inrun'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:276:in run_callbacks'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:51:insend'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:51:in run_prepare_callbacks'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:631:inprepare_dispatcher'
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:185:in process'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:insend'
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in run'<br/> C:/Development/aptana/myapp/config/environment.rb:9<br/> C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require'
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:inrequire'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in new_constants_in'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:inrequire'
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/misc.rake:4
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in call'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:inexecute'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in each'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:inexecute'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in invoke_with_call_chain'<br/> C:/Ruby/lib/ruby/1.8/monitor.rb:242:insynchronize'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in invoke_with_call_chain'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:ininvoke_prerequisites'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in each'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:ininvoke_prerequisites'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in invoke_with_call_chain'<br/> C:/Ruby/lib/ruby/1.8/monitor.rb:242:insynchronize'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in invoke_with_call_chain'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:ininvoke_prerequisites'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in each'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:ininvoke_prerequisites'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in invoke_with_call_chain'<br/> C:/Ruby/lib/ruby/1.8/monitor.rb:242:insynchronize'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in invoke_with_call_chain'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:ininvoke'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in invoke_task'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:intop_level'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in each'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:intop_level'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in standard_exception_handling'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:intop_level'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in run'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:instandard_exception_handling'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in run'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31<br/> C:/Ruby/bin/rake:19:inload'
C:/Ruby/bin/rake:19

Comments and changes to this ticket

  • Maneesh

    Maneesh May 22nd, 2010 @ 04:32 PM

    • no changes were found...
  • rdavila

    rdavila May 22nd, 2010 @ 06:17 PM

    • Tag set to invalid

    You're getting this error because the table "visibilities" doesn't exist in your database.

    Mysql::Error: Table 'dev.visibilities' doesn't exist:...

    The rake task "db:setup" is useful when you're setting up an existent app in other system, so you should not use it after create an observer.

  • Rohit Arondekar

    Rohit Arondekar July 28th, 2010 @ 10:27 AM

    • State changed from “new” to “invalid”
    • Importance changed from “” to “Low”

Create your profile

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

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Tags

Pages