我正在开发一款RAILS 4应用。 当我使用rake db:migrate im有这个错误日志
\== 20150924092537 CreateCategories: migrating =================================
-- create_table(:categories)
-- add_reference(:products, :category)
rake aborted!
StandardError: An error has occurred, all later migrations canceled:
Mysql2::Error: Table 'buynsell_development.products' doesn't exist: ALTER TABLE `products` ADD `category_id` int(11)/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:305:in `query'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:305:in `block in execute'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:473:in `block in log'
/usr/local/rvm/gems/ruby-2.2.1/gems/activesupport-4.2.3/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:467:in `log'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:305:in `execute'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/connection_adapters/mysql2_adapter.rb:231:in `execute'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:393:in `add_column'
4.2.3/lib/active_record/migration.rb:631:in `say_with_time'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/migration.rb:651:in `method_missing'
/home/ubuntu/workspace/buynsell/db/migrate/20150924092537_create_categories.rb:6:in `block in change'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:202:in `create_table'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:468:in `create_table'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/migration.rb:661:in `block in method_missing'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/migration.rb:631:in `block in say_with_time'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/migration.rb:631:in `say_with_time'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/migration.rb:651:in `method_missing'
/home/ubuntu/workspace/buynsell/db/migrate/20150924092537_create_categories.rb:3:in `change'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/migration.rb:1042:in `ddl_transaction'
/usr/local/rvm/gems/ruby-2.2.1/gems/activerecord-4.2.3/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:migrate
我的数据库如下
| Database |
+----------------------+
| information_schema |
| buynsell_development |
| buynsell_test |
| mysql |
| performance_schema |
| students_1415 |
+----------------------+
6 rows in set (0.00 sec)
有人可以帮我这个吗? 提前谢谢。