rubenrails/acts_as_opengraph — Issue #8: Error when creating DB tables
Author: docstun
Created: 2012-01-30 10:38:28+00:00
State: open

AAOG seems to break the initialization of a new database when starting the application. Maybe there should be a check if the table exists or not.

Stacktrace:

Mysql2::Error: Table 'PROJECT_production.jobs' doesn't exist: SHOW FIELDS FROM `jobs`
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activerecord-3.1.2/lib/active_record/connection_adapters/mysql2_adapter.rb:283:in `query'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activerecord-3.1.2/lib/active_record/connection_adapters/mysql2_adapter.rb:283:in `execute'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activerecord-3.1.2/lib/active_record/connection_adapters/abstract_adapter.rb:244:in `log'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activerecord-3.1.2/lib/active_record/connection_adapters/abstract_adapter.rb:239:in `log'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activerecord-3.1.2/lib/active_record/connection_adapters/mysql2_adapter.rb:283:in `execute'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activerecord-3.1.2/lib/active_record/connection_adapters/mysql2_adapter.rb:473:in `columns'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activerecord-3.1.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in `initialize'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activerecord-3.1.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:185:in `with_connection'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activerecord-3.1.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:92:in `initialize'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activerecord-3.1.2/lib/active_record/base.rb:712:in `call'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activerecord-3.1.2/lib/active_record/base.rb:712:in `default'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activerecord-3.1.2/lib/active_record/base.rb:712:in `[]'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activerecord-3.1.2/lib/active_record/base.rb:712:in `columns'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activerecord-3.1.2/lib/active_record/base.rb:728:in `column_names'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/acts_as_opengraph-0.0.5/lib/acts_as_opengraph/active_record/acts/opengraph.rb:82:in `alternative_column_name_for'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/acts_as_opengraph-0.0.5/lib/acts_as_opengraph/active_record/acts/opengraph.rb:81:in `each'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/acts_as_opengraph-0.0.5/lib/acts_as_opengraph/active_record/acts/opengraph.rb:81:in `alternative_column_name_for'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/acts_as_opengraph-0.0.5/lib/acts_as_opengraph/active_record/acts/opengraph.rb:22:in `acts_as_opengraph'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/acts_as_opengraph-0.0.5/lib/acts_as_opengraph/active_record/acts/opengraph.rb:21:in `each'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/acts_as_opengraph-0.0.5/lib/acts_as_opengraph/active_record/acts/opengraph.rb:21:in `acts_as_opengraph'
/Users/USERNAME/Projects/project_xy/app/models/job.rb:20
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:240:in `require'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:240:in `require'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:225:in `load_dependency'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:240:in `require'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:348:in `require_or_load'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:489:in `load_missing_constant'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:181:in `const_missing'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:179:in `each'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:179:in `const_missing'
/Users/USERNAME/Projects/project_xy/app/admin/jobs.rb:1
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:234:in `load'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:234:in `load'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:225:in `load_dependency'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:234:in `load'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activeadmin-0.3.4/lib/active_admin/application.rb:132:in `load!'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activeadmin-0.3.4/lib/active_admin/application.rb:132:in `each'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activeadmin-0.3.4/lib/active_admin/application.rb:132:in `load!'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activeadmin-0.3.4/lib/active_admin/application.rb:155:in `routes'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activeadmin-0.3.4/lib/active_admin.rb:63:in `__send__'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activeadmin-0.3.4/lib/active_admin.rb:63:in `routes'
/Users/USERNAME/Projects/project_xy/config/routes.rb:7
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/actionpack-3.1.2/lib/action_dispatch/routing/route_set.rb:258:in `instance_exec'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/actionpack-3.1.2/lib/action_dispatch/routing/route_set.rb:258:in `eval_block'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/actionpack-3.1.2/lib/action_dispatch/routing/route_set.rb:235:in `draw'
/Users/USERNAME/Projects/project_xy/config/routes.rb:1
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:234:in `load'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:234:in `load'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:225:in `load_dependency'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:234:in `load'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/railties-3.1.2/lib/rails/application/routes_reloader.rb:29:in `load_paths'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/railties-3.1.2/lib/rails/application/routes_reloader.rb:29:in `each'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/railties-3.1.2/lib/rails/application/routes_reloader.rb:29:in `load_paths'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/railties-3.1.2/lib/rails/application/routes_reloader.rb:13:in `reload!'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/railties-3.1.2/lib/rails/application.rb:87:in `reload_routes!'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activeadmin-0.3.4/lib/active_admin/reloader.rb:34:in `reload!'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activeadmin-0.3.4/lib/active_admin/reloader.rb:28:in `initialize'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/file_update_checker.rb:32:in `call'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/file_update_checker.rb:32:in `execute_if_updated'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activeadmin-0.3.4/lib/active_admin/reloader.rb:45:in `_callback_before_19'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/callbacks.rb:404:in `_run_prepare_callbacks'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/callbacks.rb:81:in `send'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/callbacks.rb:81:in `run_callbacks'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/actionpack-3.1.2/lib/action_dispatch/middleware/reloader.rb:46:in `prepare!'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/railties-3.1.2/lib/rails/application/finisher.rb:41
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/railties-3.1.2/lib/rails/initializable.rb:30:in `instance_exec'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/railties-3.1.2/lib/rails/initializable.rb:30:in `run'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/railties-3.1.2/lib/rails/initializable.rb:55:in `run_initializers'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/railties-3.1.2/lib/rails/initializable.rb:54:in `each'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/railties-3.1.2/lib/rails/initializable.rb:54:in `run_initializers'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/railties-3.1.2/lib/rails/application.rb:96:in `initialize!'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/railties-3.1.2/lib/rails/railtie/configurable.rb:30:in `send'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/railties-3.1.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/USERNAME/Projects/project_xy/config/environment.rb:5
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:240:in `require'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:240:in `require'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:223:in `load_dependency'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:640:in `new_constants_in'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:223:in `load_dependency'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:240:in `require'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/railties-3.1.2/lib/rails/application.rb:83:in `require_environment!'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/railties-3.1.2/lib/rails/application.rb:193:in `initialize_tasks'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/Users/USERNAME/.rvm/rubies/ree-1.8.7-2011.12/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `invoke_prerequisites'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `invoke_with_call_chain'
/Users/USERNAME/.rvm/rubies/ree-1.8.7-2011.12/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/gems/rake-0.9.2.2/bin/rake:33
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/bin/rake:19:in `load'
/Users/USERNAME/.rvm/gems/ree-1.8.7-2011.12@PROJECT/bin/rake:19

Otherwise it is not possible to migrate an empty database without removing the acts_as_opengraph lines before executing db:migrate.

Thank you!