自分がしたいこと
ActiveRecord::PendingMigrationError
Migrations are pending. To resolve this issue, run: bin/rails db:migrate RAILS_ENV=development
このエラーを解消したいです。
コード ```### 自分が考えたこと [リンク内容](https://qiita.com/kanuu/items/a9223712ee0ff8d19d56) この記事を参考にして すでに存在しているusersを消してやろうと思ったのですが、 これをしてみると == 20200813043854 CreateUsers: migrating ====================================== -- create_table(:users) rails aborted! StandardError: An error has occurred, all later migrations canceled: Mysql2::Error: Table 'users' already exists: CREATE TABLE `users` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/mysql2-0.5.3/lib/mysql2/client.rb:131:in `_query' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/mysql2-0.5.3/lib/mysql2/client.rb:131:in `block in query' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/mysql2-0.5.3/lib/mysql2/client.rb:130:in `handle_interrupt' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/mysql2-0.5.3/lib/mysql2/client.rb:130:in `query' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:187:in `block (2 levels) in execute' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.4.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:186:in `block in execute' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:580:in `block in log' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.4.3/lib/active_support/notifications/instrumenter.rb:23:in `instrument' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:571:in `log' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:185:in `execute' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/mysql/database_statements.rb:28:in `execute' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:311:in `create_table' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:871:in `block in method_missing' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:840:in `block in say_with_time' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:840:in `say_with_time' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:860:in `method_missing' /home/ec2-user/environment/goodbooks/db/migrate/20200813043854_create_users.rb:3:in `change' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:814:in `exec_migration' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:798:in `block (2 levels) in migrate' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:797:in `block in migrate' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:796:in `migrate' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:977:in `migrate' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1345:in `ddl_transaction' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1263:in `block in migrate_without_lock' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1262:in `each' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1262:in `migrate_without_lock' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1210:in `block in migrate' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1363:in `with_advisory_lock' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1210:in `migrate' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1036:in `up' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1011:in `migrate' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/tasks/database_tasks.rb:172:in `migrate' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.4.3/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/railties-5.2.4.3/lib/rails/commands/rake/rake_command.rb:23:in `block in perform' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/railties-5.2.4.3/lib/rails/commands/rake/rake_command.rb:20:in `perform' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/railties-5.2.4.3/lib/rails/command.rb:48:in `invoke' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/railties-5.2.4.3/lib/rails/commands.rb:18:in `<top (required)>' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `block in require' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:257:in `load_dependency' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `require' /home/ec2-user/environment/goodbooks/bin/rails:9:in `<top (required)>' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.1.0/lib/spring/client.rb:30:in `run' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.1.0/bin/spring:49:in `<top (required)>' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load' /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>' /home/ec2-user/environment/goodbooks/bin/spring:15:in `require' /home/ec2-user/environment/goodbooks/bin/spring:15:in `<top (required)>' bin/rails:3:in `load' bin/rails:3:in `<main>' というようにusersがalready existなのでとなりできませんでした。 これについての解決策を教えてください。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/08/13 06:35