简体   繁体   English

rake db:migrate 报错

[英]rake db:migrate gives an error

I just tried to migrate, but my console returns this我只是尝试迁移,但我的控制台返回了这个

StandardError: An error has occurred, this and all later migrations canceled:标准错误:发生错误,这次和所有以后的迁移都取消了:

SQLite3::SQLException: duplicate column name: encrypted_password: ALTER TABLE "users" ADD "encrypted_password" varchar DEFAULT '' NOT NULL SQLite3::SQLException: 重复列名:encrypted_pa​​ssword: ALTER TABLE "users" ADD "encrypted_pa​​ssword" varchar DEFAULT '' NOT NULL

I understand that I accidentally created a table twice and have to do changes in my migration file?我知道我不小心创建了两次表并且必须更改我的迁移文件? If so, where can I find it?如果是这样,我在哪里可以找到它? Dropping the whole database would be a good solution, too in my case.在我的情况下,删除整个数据库也是一个很好的解决方案。

I just need to know how.我只需要知道怎么做。 All the solutions I found so far didn't work for me.到目前为止我找到的所有解决方案都不适合我。

UPDATE: When I do更新:当我做

rake db:migrate:down VERSION=20160914093125耙分贝:迁移:向下版本=20160914093125

The console says控制台说

== 20160914093125 DeviseCreateUsers: reverting ================================ -- remove_index(:users, {:column=>:reset_password_token}) -> 0.0013s -- remove_index(:users, {:column=>:email}) -> 0.0006s -- drop_table(:users) -> 0.0003s == 20160914093125 DeviseCreateUsers: reverted (0.0025s) ======================= == 20160914093125 DeviseCreateUsers:恢复 ================================ -- remove_index(:users, {:column==> :reset_password_token}) -> 0.0013s -- remove_index(:users, {:column=>:email}) -> 0.0006s -- drop_table(:users) -> 0.0003s == 20160914093125 DeviseCreateUsers: 回复 (0.025s) ======================

Are these the points i should change?这些是我应该改变的点吗?

3123(...)devise_create_user.rb 3123(...)devise_create_user.rb

class DeviseCreateUsers < ActiveRecord::Migration[5.0]
  def change
    create_table :users do |t|
      ## Database authenticatable
      t.string :email,              null: false, default: ""
      t.string :encrypted_password, null: false, default: ""

      ## Recoverable
      t.string   :reset_password_token
      t.datetime :reset_password_sent_at

      ## Rememberable
      t.datetime :remember_created_at

      ## Trackable
      t.integer  :sign_in_count, default: 0, null: false
      t.datetime :current_sign_in_at
      t.datetime :last_sign_in_at
      t.string   :current_sign_in_ip
      t.string   :last_sign_in_ip

      ## Confirmable
      # t.string   :confirmation_token
      # t.datetime :confirmed_at
      # t.datetime :confirmation_sent_at
      # t.string   :unconfirmed_email # Only if using reconfirmable

      ## Lockable
      # t.integer  :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
      # t.string   :unlock_token # Only if unlock strategy is :email or :both
      # t.datetime :locked_at


      t.timestamps null: false
    end

    add_index :users, :email,                unique: true
    add_index :users, :reset_password_token, unique: true
    # add_index :users, :confirmation_token,   unique: true
    # add_index :users, :unlock_token,         unique: true
  end
end

Console after trying to migrate:尝试迁移后的控制台:

== 20160915185631 AddDeviseToUsers: migrating ================================= -- change_table(:users) rake aborted! == 20160915185631 AddDeviseToUsers:迁移 ================================== -- change_table(:users) rake 中止! StandardError: An error has occurred, this and all later migrations canceled:标准错误:发生错误,这次和所有以后的迁移都取消了:

SQLite3::SQLException: no such table: users: ALTER TABLE "users" ADD "email" varchar DEFAULT '' NOT NULL /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:91:in initialize' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:91:in new' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:91:in prepare' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:134:in execute' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in block in execute' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:566:in block in log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in instrument' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:560:in SQLite3::SQLException:没有这样的表:用户:ALTER TABLE "users" ADD "email" varchar DEFAULT '' NOT NULL /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/ lib/sqlite3/database.rb:91:in initialize' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:91:in new /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:91:in prepare' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:134:in execute' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/ active_record/connection_adapters/sqlite3_adapter.rb:232:in block in execute' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:566:in block in log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in instrument' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:560:in instrument' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:560:in log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in execute' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:547:in add_column' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:373:in add_column' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:475:in column' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:181:in block in string' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:181:in each' /Us instrument' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:560:in log' instrument' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:560:in /sqlite3_adapter.rb:232:in execute' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:547:in add_column ' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:373:in add_column' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:475:in列'/Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord -5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:181:in block in string' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:181:in each' /Us ers/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:181:in string' /Users/matthiascordes/code/recipe_box/db/migrate/20160915185631_add_devise_to_users.rb:5:in block in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:443:in change_table' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:845:in block in method_missing' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:814:in block in say_with_time' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:814:in say_with_time' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:834:in method_missing' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:596:in ers/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:181:in string' /Users/matthiascordes/code/recipe_box/db/migrate/20160915185631_add_devise_to_users.rb:5:in block in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/statements.rbschema: 443:in change_table' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:845:in /Users/matthiascordes/ change_table' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:845:in / change_table' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:845:in / change_table' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:845:in / change_table' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:845:in / change_table' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:845:in / change_table' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:845:in / change_table' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:845:in / change_table' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:845:in : change_table' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:845:in :in block in method_missing' /Users/matthiascordes/。 rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:814:in block in say_with_time' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:814:in say_with_time' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration。 rb:834:in method_missing' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:596:in method_missing' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:596:in method_missing' /Users/matthiascordes/code/recipe_box/db/migrate/20160915185631_add_devise_to_users.rb:3:in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:751:in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:791:in exec_migration' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:772:in block (2 levels) in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:771:in block in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:398:in with_connection' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:770:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:950:in method_missing' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:596:in method_missing' /Users/matthiascordes/code/recipe_box/db/migrate/20160915185631_add_devise_to_users.rb:3:in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:751:in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration。 rb:791:in exec_migration' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:772:in block (2 levels) in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:771:in block in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:398:in with_connection' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord- 5.0.0.1/lib/active_record/migration.rb:770:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:950:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:950:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1211:in block in execute_migration_in_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1279:in block in ddl_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in block in transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/transaction.rb:189:in within_new_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/transactions.rb:211:in transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/acti migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:950:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1211:in block in execute_migration_in_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1279:in块 /Users/matthiascordes/.rvm/gems/ruby-2.3 .1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:232: block in transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/transaction.rb:189:in inside_new_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters /abstract/database_statements.rb:232:in transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/transactions.rb:211:in transaction' /用户/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/acti ve_record/migration.rb:1279:in ddl_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1210:in execute_migration_in_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1183:in block in migrate_without_lock' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1182:in each' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1182:in migrate_without_lock' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1133:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1005:in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:983:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_re ve_record/migration.rb:1279:in ddl_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1210:in '/Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb: ddl_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1210:in :in execute_migration_in_transaction' /matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1183:in block in migrate_without_lock' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1182:in每个'/Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/ active_record/migration.rb:1182:in migrate_without_lock' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1133:in migrate' /Users /matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1005:in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:983:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_re cord/tasks/database_tasks.rb:161:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/railties/databases.rake:58:in block (2 levels) in ' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/exe/rake:27:in <top (required)>' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in eval' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in <main>' ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: users: ALTER TABLE "users" ADD "email" varchar DEFAULT '' NOT NULL /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:91:in initialize' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:91:in new' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:91:in prepare' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:134:in execute' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in cord/tasks/database_tasks.rb:161:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/railties/databases.rake:58:in ' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/exe/rake:27:in <top (required)>' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in块(2级) <top (required)>' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in eval' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in <main>' ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: users: ALTER TABLE "users" ADD "email" varchar DEFAULT '' NOT NULL /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:91:in初始化'/Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:91:in new' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:91:in prepare' /Users/matthiascordes/.rvm/gems/ruby -2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:134:in execute' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in execute' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in block in execute' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:566:in block in log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in instrument' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:560:in log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in execute' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:547:in add_column' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:373:in add_colu execute' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in block in execute' /Users/matthiascordes/.rvm/gems/ruby- 2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:566:in block in log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in instrument'/Users block in log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in matthiascordes block in log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in .rvm block in log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in gems block in log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in ruby-2.3.1 block in log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in gems block in log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in activerecord-5.0.0.1 block in log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in connection_adapters block in log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in abstract_adapter。 rb:560:in log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in '/Users/matthiascordes/ log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in / log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in / log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in / log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in / log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in / log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in / log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in / log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in / log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in : log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in :in执行'/Users/matthiascordes /.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:547:in add_column' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:373:in add_colu mn' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:475:in column' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:181:in block in string' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:181:in each' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:181:in string' /Users/matthiascordes/code/recipe_box/db/migrate/20160915185631_add_devise_to_users.rb:5:in block in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:443:in change_table' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:845:in block in method_missing' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:814:in mn' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:475:in column' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:181:in block in string' /Users/matthiascordes/.rvm/gems/ruby-2.3。 1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:181:in each' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:181:in string' /Users/matthiascordes/code/recipe_box/db/migrate/20160915185631_add_devise_to_users.rb:5:in block in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:443:in change_table' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems /activerecord-5.0.0.1/lib/active_record/migration.rb:845:in block in method_missing' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:814:in block in method_missing' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:814:in block in say_with_time' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:814:in say_with_time' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:834:in method_missing' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:596:in method_missing' /Users/matthiascordes/code/recipe_box/db/migrate/20160915185631_add_devise_to_users.rb:3:in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:751:in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:791:in exec_migration' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:772:in block (2 levels) in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:771:in block in method_missing' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:814:in block in say_with_time' /Users/matthiascordes/.rvm/ gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:814:in say_with_time' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:834:in method_missing' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:596:在method_missing' /Users/matthiascordes/code/recipe_box/db/migrate/20160915185631_add_devise_to_users.rb:3:in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5. /active_record/migration.rb:751:in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:791:in exec_migration' /用户/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:772:in block (2 levels) in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:771:in block (2 levels) in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:771:in block in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:398:in with_connection' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:770:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:950:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1211:in block in execute_migration_in_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1279:in block in ddl_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in block in transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/ block (2 levels) in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:771:in block in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3。 1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:398:in with_connection' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:770:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:950:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1211:in块在 execute_migration_in_transaction' /Users/matthiascordes/.rvm/gems/ ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1279:in block in ddl_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in in 交易块'/Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/ activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/transaction.rb:189:in within_new_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/transactions.rb:211:in transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1279:in ddl_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1210:in execute_migration_in_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1183:in block in migrate_without_lock' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1182:in each' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1182:in activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/transaction.rb:189:in within_new_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/transactions.rb:211:in transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1279:in ddl_transaction' /Users/matthiascordes/.rvm/gems/ruby- 2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1210:in execute_migration_in_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1183:in block in migrate_without_lock' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1182:in each' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1182:in each' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1182:in migrate_without_lock' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1133:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1005:in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:983:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/tasks/database_tasks.rb:161:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/railties/databases.rake:58:in block (2 levels) in <top (required)>' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/exe/rake:27:in ' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in eval' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in ' SQLite3::SQLException: no such table: users /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/ each' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1182:in migrate_without_lock' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1133:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1005:in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1 /gems/activerecord-5.0.0.1/lib/active_record/migration.rb:983:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/tasks/database_tasks.rb:161:in /database_tasks.rb:161:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/railties/databases.rake:58:in block (2 levels) in <top (required)>' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/exe/rake:27:in ' /Users/matthiascordes/.rvm /gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in eval' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in ' SQLite3::SQLException: 没有这样的表: 用户 /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/ sqlite3-1.3.11/lib/sqlite3/database.rb:91:in initialize' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:91:in new' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:91:in prepare' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:134:in execute' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in block in execute' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:566:in block in log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in instrument' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:560:in log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0. sqlite3-1.3.11/lib/sqlite3/database.rb:91:in initialize' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:91:in new' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:91:in prepare' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:134:in execute' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord- 5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in block in execute' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:566:in block in log' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in instrument' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:560:in log' /Users/matthiascordes/.rvm/gems/ ruby-2.3.1/gems/activerecord-5.0。 0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in execute' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:547:in add_column' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:373:in add_column' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:475:in column' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:181:in block in string' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:181:in each' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:181:in string' /Users/matthiascordes/code/recipe_box/db/migrate/20160915185631_add_devise_to_users.rb:5:in 0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:232:in execute' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:547:in add_column' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:373:in add_column' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:475:in column' /Users/matthiascordes/.rvm/gems/ruby- 2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:181:in block in string' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:181:in每个'/Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/ connection_adapters/abstract/schema_definitions.rb:181:in string' /Users/matthiascordes/code/recipe_box/db/migrate/20160915185631_add_devise_to_users.rb:5:in string' /Users/matthiascordes/code/recipe_box/db/migrate/20160915185631_add_devise_to_users.rb:5:in block in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:443:in change_table' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:845:in block in method_missing' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:814:in block in say_with_time' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:814:in say_with_time' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:834:in method_missing' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:596:in method_missing' /Users/matthiascordes/code/recipe_box/db/migrate/20160915185631_add_devise_to_users.rb:3:in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:751:in string' /Users/matthiascordes/code/recipe_box/db/migrate/20160915185631_add_devise_to_users.rb:5:in block in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0/active_record /connection_adapters/abstract/schema_statements.rb:443:in change_table' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:845:in block在method_missing'/Users block in say_with_time' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:814:in in block in say_with_time' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:814:in say_with_time' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0 .0.1/lib/active_record/migration.rb:834:in method_missing' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:596:in method_missing' up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:751:in in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:751:in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:751:in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:791:in exec_migration' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:772:in block (2 levels) in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:771:in block in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:398:in with_connection' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:770:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:950:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1211:in block in execute_migration_in_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1279:in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:751:in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/ gems/activerecord-5.0.0.1/lib/active_record/migration.rb:791:in exec_migration' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:772:in block (2 levels) in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:771:in block in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:398:in with_connection' /Users/matthiascordes/。 rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:770:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:950:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb: 1211: block in execute_migration_in_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1279:in中的block in execute_migration_in_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1279:in block in execute_migration_in_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1279:in block in ddl_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in block in transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/transaction.rb:189:in within_new_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/transactions.rb:211:in transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1279:in ddl_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1210:in block in execute_migration_in_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1279:in ddl_transaction' /Users/matthiascordes/.rvm/gems /ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in block in transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/transaction.rb:189:in inside_new_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib /active_record/connection_adapters/abstract/database_statements.rb:232:in transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/transactions.rb:211:in交易'/Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1279:in ddl_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1210:in matthiascordes/ ddl_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1210:in ddl_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1210:in execute_migration_in_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1183:in block in migrate_without_lock' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1182:in each' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1182:in migrate_without_lock' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1133:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1005:in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:983:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/tasks/database_tasks.rb:161:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/railties/databases.rake:58:in ddl_transaction' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1210:in execute_migration_in_transaction'/Users/ block in migrate_without_lock' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1182:in in block in migrate_without_lock' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1182:in each' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0 .0.1/lib/active_record/migration.rb:1182:in migrate_without_lock' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1133:in迁移'/Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:1005:in up' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/migration.rb:983:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1 /lib/active_record/tasks/database_tasks.rb:161:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/railties/databases.rake:58:in migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/railties/databases.rake:58:in block (2 levels) in ' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/exe/rake:27:in <top (required)>' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in eval' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `' migrate' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.1/lib/active_record/railties/databases.rake:58:in块(2 级)在“/Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/rake-11.2.2/exe/rake:27:in <top (required)>' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in eval' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `'

If you know the migration file, which you want to revert back, then use this,如果您知道要恢复的迁移文件,请使用此文件,

For eg, if this is the migration file,
20123219103503_add_name_field_to_user.rb

then copy the numbers in the file and then run the following in your terminal prompt,然后复制文件中的数字,然后在终端提示中运行以下命令,

rake db:migrate:down VERSION=20123219103503

make editions in the migration files, then run在迁移文件中制作版本,然后运行

rake db:migrate

from terminal从终端

You may have modified the database schema manually or changed a migration file being run.您可能已经手动修改了数据库架构或更改了正在运行的迁移文件。

If you dont need the data in the database, a rake db:reset would re-run all migrations from scratch.如果您不需要数据库中的数据, rake db:reset将从头开始重新运行所有迁移。

You could also try to migrate your database to version 0 with command: rake db:migrate VERSION=0 and then run rake db:migrate您还可以尝试使用以下命令将数据库迁移到版本 0: rake db:migrate VERSION=0然后运行rake db:migrate


If you want to drop the whole database as you stated, you can do either of the following:如果您想删除整个数据库,您可以执行以下任一操作:

rake db:drop simply drops the whole database. rake db:drop只是删除整个数据库。

rake db:reset db:migrate will reset your database and reload the current schema. rake db:reset db:migrate将重置您的数据库并重新加载当前模式。

rake db:drop db:create db:migrate will destroy your database and then create it and then migrate your current schema. rake db:drop db:create db:migrate将破坏您的数据库,然后创建它,然后迁移您当前的架构。

All data will be lost in the above 3 scenarios.以上3种情况下,所有数据都会丢失。


You could also comment out the method in the migration file, then run rake db:migrate as below:您也可以将迁移文件中的方法注释掉,然后运行rake db:migrate如下:

Normal Migration File:正常迁移文件:

class AddEncryptedPaddwordToUsers < ActiveRecord::Migration
  def change
    add_column :users, :encrypted_password, :string
  end
end

Just comment out the method but leave the class, so it would be:只需注释掉该方法但离开类,所以它是:

class AddEncryptedPaddwordToUsers < ActiveRecord::Migration
  # def change
  #   add_column :users, :encrypted_password, :string
  # end
end

Then run rake db:migrate .然后运行rake db:migrate Essentially this is a work around that tells rails to skip the migration本质上,这是一个告诉 rails 跳过迁移的解决方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM