Rails migration problem, Table doesn't exist

Hello, I’m starting with Rails. I have problems at the time of migration.

The steps I follow are:

rake db:create:all

rake db:migrate

then

rake aborted!

Mysql2::Error: Table ‘lpaguide.resources’ doesn’t exist: SHOW FIELDS FROM resources

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.1.10/lib/active_record/connection_adapters/mysql2_adapter.rb:288:in `query’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.1.10/lib/active_record/connection_adapters/mysql2_adapter.rb:288:in `block in execute’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.1.10/lib/active_record/connection_adapters/abstract_adapter.rb:245:in `block in log’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/notifications/instrumenter.rb:21:in `instrument’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.1.10/lib/active_record/connection_adapters/abstract_adapter.rb:240:in `log’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.1.10/lib/active_record/connection_adapters/mysql2_adapter.rb:288:in `execute’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.1.10/lib/active_record/connection_adapters/mysql2_adapter.rb:474:in `columns’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.1.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in `block (2 levels) in initialize’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.1.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:185:in `with_connection’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.1.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:92:in `block in initialize’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.1.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:106:in `yield’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.1.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:106:in `default’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.1.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:106:in `block in initialize’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.1.10/lib/active_record/base.rb:717:in `yield’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.1.10/lib/active_record/base.rb:717:in `default’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.1.10/lib/active_record/base.rb:717:in `columns_hash’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.1.10/lib/active_record/base.rb:827:in `descends_from_active_record?’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.1.10/lib/active_record/base.rb:833:in `finder_needs_type_condition?’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.1.10/lib/active_record/base.rb:985:in `relation’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.1.10/lib/active_record/named_scope.rb:36:in `scoped’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.1.10/lib/active_record/base.rb:444:in `where’

/var/www/lpaguide/app/models/event.rb:9:in `class:Event

/var/www/lpaguide/app/models/event.rb:1:in `<top (required)>’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:240:in `require’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:240:in `block in require’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:225:in `load_dependency’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:240:in `require’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:348:in `require_or_load’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:489:in `load_missing_constant’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:181:in `block in const_missing’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:179:in `each’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:179:in `const_missing’

/var/www/lpaguide/app/admin/events.rb:1:in `<top (required)>’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:234:in `load’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:234:in `block in load’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:225:in `load_dependency’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:234:in `load’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activeadmin-0.4.0/lib/active_admin/application.rb:161:in `block in load!’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activeadmin-0.4.0/lib/active_admin/application.rb:161:in `each’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activeadmin-0.4.0/lib/active_admin/application.rb:161:in `load!’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activeadmin-0.4.0/lib/active_admin/application.rb:187:in `routes’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activeadmin-0.4.0/lib/active_admin.rb:78:in `routes’

/var/www/lpaguide/config/routes.rb:51:in `block in <top (required)>’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.1.10/lib/action_dispatch/routing/route_set.rb:264:in `instance_exec’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.1.10/lib/action_dispatch/routing/route_set.rb:264:in `eval_block’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.1.10/lib/action_dispatch/routing/route_set.rb:241:in `draw’

/var/www/lpaguide/config/routes.rb:1:in `<top (required)>’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:234:in `load’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:234:in `block in load’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:225:in `load_dependency’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:234:in `load’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.1.10/lib/rails/application/routes_reloader.rb:29:in `block in load_paths’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.1.10/lib/rails/application/routes_reloader.rb:29:in `each’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.1.10/lib/rails/application/routes_reloader.rb:29:in `load_paths’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.1.10/lib/rails/application/routes_reloader.rb:13:in `reload!’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.1.10/lib/rails/application.rb:87:in `reload_routes!’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activeadmin-0.4.0/lib/active_admin/reloader.rb:34:in `reload!’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activeadmin-0.4.0/lib/active_admin/reloader.rb:98:in `reload!’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activeadmin-0.4.0/lib/active_admin/reloader.rb:93:in `block in initialize’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/file_update_checker.rb:32:in `call’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/file_update_checker.rb:32:in `execute_if_updated’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activeadmin-0.4.0/lib/active_admin/reloader.rb:84:in `execute_if_updated’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activeadmin-0.4.0/lib/active_admin/reloader.rb:110:in `block in attach!’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/callbacks.rb:404:in `_run_prepare_callbacks’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/callbacks.rb:81:in `run_callbacks’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.1.10/lib/action_dispatch/middleware/reloader.rb:46:in `prepare!’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.1.10/lib/rails/application/finisher.rb:41:in `block in module:Finisher

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.1.10/lib/rails/initializable.rb:30:in `instance_exec’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.1.10/lib/rails/initializable.rb:30:in `run’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.1.10/lib/rails/initializable.rb:55:in `block in run_initializers’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.1.10/lib/rails/initializable.rb:54:in `each’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.1.10/lib/rails/initializable.rb:54:in `run_initializers’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.1.10/lib/rails/application.rb:96:in `initialize!’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.1.10/lib/rails/railtie/configurable.rb:30:in `method_missing’

/var/www/lpaguide/config/environment.rb:5:in `<top (required)>’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:240:in `require’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:240:in `block in require’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:223:in `block in load_dependency’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:640:in `new_constants_in’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:223:in `load_dependency’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:240:in `require’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.1.10/lib/rails/application.rb:83:in `require_environment!’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.1.10/lib/rails/application.rb:203:in `block (2 levels) in initialize_tasks’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/lib/rake/task.rb:228:in `call’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/lib/rake/task.rb:228:in `block in execute’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/lib/rake/task.rb:223:in `each’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/lib/rake/task.rb:223:in `execute’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/lib/rake/task.rb:166:in `block in invoke_with_call_chain’

/home/deployer/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/lib/rake/task.rb:159:in `invoke_with_call_chain’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/lib/rake/task.rb:187:in `block in invoke_prerequisites’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/lib/rake/task.rb:185:in `each’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/lib/rake/task.rb:185:in `invoke_prerequisites’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/lib/rake/task.rb:165:in `block in invoke_with_call_chain’

/home/deployer/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/lib/rake/task.rb:159:in `invoke_with_call_chain’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/lib/rake/task.rb:152:in `invoke’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/lib/rake/application.rb:143:in `invoke_task’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/lib/rake/application.rb:101:in `block (2 levels) in top_level’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/lib/rake/application.rb:101:in `each’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/lib/rake/application.rb:101:in `block in top_level’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/lib/rake/application.rb:110:in `run_with_threads’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/lib/rake/application.rb:95:in `top_level’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/lib/rake/application.rb:73:in `block in run’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/lib/rake/application.rb:70:in `run’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/gems/rake-10.0.3/bin/rake:33:in `<top (required)>’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/bin/rake:23:in `load’

/home/deployer/.rvm/gems/ruby-1.9.3-p448/bin/rake:23:in `’

I do not know what could be the problem, please help :slight_smile:

Hello ,
I think rake db:create not create:all

its better to use always bundle exec rake db:create

and bundle exec rake db:migrate and bundle exec rake db:seed

or instead of all these commands ****you can use also this command bundle exec rake db:setup