Rails bundle exec rake db:reset 出现了奇怪的错误

sensi · 2014年04月24日 · 最后由 dddd1919 回复于 2014年04月25日 · 3486 次阅读
Unknown database 'sample_app'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/mysql2-0.3.15/lib/mysql2/client.rb:67:in `connect'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/mysql2-0.3.15/lib/mysql2/client.rb:67:in `initialize'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/connection_adapters/mysql2_adapter.rb:18:in `new'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/connection_adapters/mysql2_adapter.rb:18:in `mysql2_connection'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in `new_connection'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:450:in `checkout_new_connection'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in `acquire_connection'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:356:in `block in checkout'
/Users/ranran/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in `checkout'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection'
/Users/ranran/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in `retrieve_connection'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/connection_handling.rb:79:in `retrieve_connection'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/connection_handling.rb:53:in `connection'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/tasks/mysql_database_tasks.rb:8:in `connection'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/tasks/mysql_database_tasks.rb:41:in `drop'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/tasks/database_tasks.rb:98:in `drop'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/tasks/database_tasks.rb:110:in `block in drop_current'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/tasks/database_tasks.rb:183:in `block in each_current_configuration'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/tasks/database_tasks.rb:182:in `each'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/tasks/database_tasks.rb:182:in `each_current_configuration'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/tasks/database_tasks.rb:109:in `drop_current'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/railties/databases.rake:35:in `block (2 levels) in <top (required)>'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/Users/ranran/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/railties/databases.rake:139:in `block (2 levels) in <top (required)>'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/Users/ranran/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/application.rb:149:in `invoke_task'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/application.rb:106:in `each'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/application.rb:106:in `block in top_level'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/application.rb:115:in `run_with_threads'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/application.rb:100:in `top_level'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/application.rb:78:in `block in run'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/bin/rake:23:in `load'
/Users/ranran/.rvm/gems/ruby-2.0.0-p451/bin/rake:23:in `<main>'
Couldn't drop sample_app
sample_app already exists
-- create_table("users", {:force=>true})
   -> 0.0607s
-- add_index("users", ["email"], {:name=>"index_users_on_email", :unique=>true, :using=>:btree})
   -> 0.1683s
-- add_index("users", ["remember_token"], {:name=>"index_users_on_remember_token", :using=>:btree})
   -> 0.1204s
-- initialize_schema_migrations_table()
   -> 0.2223s

Couldn't drop sample_app sample_app already exists

这个什么情况

手动drop sample_app

需要 登录 后方可回复, 如果你还没有账号请 注册新账号