Rake db:migrate and ..."doesn't exist: SHOW FULL FIELDS FROM"... #1273

Closed
swistaczek opened this Issue Aug 8, 2012 · 7 comments

Comments

Projects
None yet
7 participants
@swistaczek

Hi,
I have added ``rails_admin do` block to couple models. When I try to deploy my app, and rake db:migrate runs I get following error:

 ** [out :: zobacz.re] rake aborted!
 ** [out :: zobacz.re] Mysql2::Error: Table 'homecard_staging.profit_cards' doesn't exist: SHOW FULL FIELDS FROM `profit_cards`
 ** [out :: zobacz.re] 
 ** [out :: zobacz.re] Tasks: TOP => db:migrate => environment
 ** [out :: zobacz.re] (See full trace by running task with --trace)
    command finished in 6480ms
*** [deploy:update_code] rolling back

Thanks in advantage for any help or suggestions.

Stack trace:

** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Invoke disable_rails_admin_initializer (first_time)
** Execute disable_rails_admin_initializer
** Execute environment
rake aborted!
Mysql2::Error: Table 'homecard_staging.profit_cards' doesn't exist: SHOW FULL FIELDS FROM `profit_cards`
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:243:in `query'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:243:in `block in execute'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:243:in `execute'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/mysql2_adapter.rb:211:in `execute'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:257:in `execute_and_free'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:424:in `columns'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/schema_cache.rb:12:in `block in initialize'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/model_schema.rb:228:in `yield'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/model_schema.rb:228:in `default'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/model_schema.rb:228:in `columns'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/rails_admin-0.0.5/lib/rails_admin/adapters/active_record.rb:83:in `properties'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/rails_admin-0.0.5/lib/rails_admin/config/fields.rb:50:in `factory'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/rails_admin-0.0.5/lib/rails_admin/config/has_fields.rb:129:in `_fields'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/rails_admin-0.0.5/lib/rails_admin/config/has_fields.rb:127:in `_fields'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/rails_admin-0.0.5/lib/rails_admin/config/has_fields.rb:7:in `field'
@swistaczek

This comment has been minimized.

Show comment Hide comment
@swistaczek

swistaczek Aug 8, 2012

Adding unless File.basename($0) == 'rake' to block do the job but this is so dirty solution :(.

Adding unless File.basename($0) == 'rake' to block do the job but this is so dirty solution :(.

@ehoch

This comment has been minimized.

Show comment Hide comment
@ehoch

ehoch Sep 17, 2012

Contributor

I'm also running into the same problem since moving my rails_admin from the deprecated initializer to the models. Any real fix?

Contributor

ehoch commented Sep 17, 2012

I'm also running into the same problem since moving my rails_admin from the deprecated initializer to the models. Any real fix?

@willfults

This comment has been minimized.

Show comment Hide comment
@willfults

willfults Oct 4, 2012

+1 Getting a similar issue

+1 Getting a similar issue

@bbenezech

This comment has been minimized.

Show comment Hide comment
@bbenezech

bbenezech Oct 4, 2012

Collaborator

Can you retry with

gem 'rails_admin', github: 'sferik/rails_admin'
Collaborator

bbenezech commented Oct 4, 2012

Can you retry with

gem 'rails_admin', github: 'sferik/rails_admin'
@brunnogomes

This comment has been minimized.

Show comment Hide comment
@brunnogomes

brunnogomes Jan 5, 2013

I had this issue too in a new project, using rails_admin 0.3.0 and devise 2.1.2.

I had to comment the "rails_admin do" part of the model so the migrations could run.

Also, the SKIP_RAILS_ADMIN_INITIALIZER=false doesn't deal with this (actually I don't know if it should, just mentioning).

I had this issue too in a new project, using rails_admin 0.3.0 and devise 2.1.2.

I had to comment the "rails_admin do" part of the model so the migrations could run.

Also, the SKIP_RAILS_ADMIN_INITIALIZER=false doesn't deal with this (actually I don't know if it should, just mentioning).

@amritdeep

This comment has been minimized.

Show comment Hide comment
@amritdeep

amritdeep Jan 29, 2013

I am getting "RailsAdmin initialization disabled by default. Pass SKIP_RAILS_ADMIN_INITIALIZER=false if you need it" this error, what should I do ????

I am getting "RailsAdmin initialization disabled by default. Pass SKIP_RAILS_ADMIN_INITIALIZER=false if you need it" this error, what should I do ????

@mshibuya

This comment has been minimized.

Show comment Hide comment
@mshibuya

mshibuya Nov 10, 2014

Collaborator

Maybe fixed by 6c72e7d.
Please reopen if the problem still exists.

Collaborator

mshibuya commented Nov 10, 2014

Maybe fixed by 6c72e7d.
Please reopen if the problem still exists.

@mshibuya mshibuya closed this Nov 10, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment