🎄teratailクリスマスプレゼントキャンペーン2024🎄』開催中!

\teratail特別グッズやAmazonギフトカード最大2,000円分が当たる!/

詳細はこちら
Ruby on Rails 6

Ruby on Rails 6は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

1回答

1297閲覧

サーバーが立ち上がらずエラーが出ますActiveRecord::PendingMigrationError Migrations are pending. To resolve this is

yoshi-00

総合スコア2

Ruby on Rails 6

Ruby on Rails 6は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2021/03/15 05:58

編集2021/03/15 20:41

イメージ説明### 前提・実現したいこと
エラーを解除したいです。
rails 初学者です。
現在railsチュートリアルの第2章をやっており ActiveRecord::PendingMigrationError  Migrations are pending. To resolve this issue, run: rails db:migrate RAILS_ENV=developmentが出てきてエラーが消えません。

発生している問題・エラーメッセージ

ActiveRecord::PendingMigrationError  Migrations are pending. To resolve this issue, run: rails db:migrate RAILS_ENV=development Rails.root: /home/ubuntu/environment/toy_app Application Trace | Framework Trace | Full Trace activerecord (6.0.3) lib/active_record/migration.rb:586:in `check_pending!' activerecord (6.0.3) lib/active_record/migration.rb:564:in `call' actionpack (6.0.3) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call' activesupport (6.0.3) lib/active_support/callbacks.rb:101:in `run_callbacks' actionpack (6.0.3) lib/action_dispatch/middleware/callbacks.rb:26:in `call' actionpack (6.0.3) lib/action_dispatch/middleware/executor.rb:14:in `call' actionpack (6.0.3) lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call' actionpack (6.0.3) lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call' web-console (4.0.1) lib/web_console/middleware.rb:132:in `call_app' web-console (4.0.1) lib/web_console/middleware.rb:19:in `block in call' web-console (4.0.1) lib/web_console/middleware.rb:17:in `catch' web-console (4.0.1) lib/web_console/middleware.rb:17:in `call' actionpack (6.0.3) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call' railties (6.0.3) lib/rails/rack/logger.rb:37:in `call_app' railties (6.0.3) lib/rails/rack/logger.rb:26:in `block in call' activesupport (6.0.3) lib/active_support/tagged_logging.rb:80:in `block in tagged' activesupport (6.0.3) lib/active_support/tagged_logging.rb:28:in `tagged' activesupport (6.0.3) lib/active_support/tagged_logging.rb:80:in `tagged' railties (6.0.3) lib/rails/rack/logger.rb:26:in `call' sprockets-rails (3.2.2) lib/sprockets/rails/quiet_assets.rb:13:in `call' actionpack (6.0.3) lib/action_dispatch/middleware/remote_ip.rb:81:in `call' actionpack (6.0.3) lib/action_dispatch/middleware/request_id.rb:27:in `call' rack (2.2.3) lib/rack/method_override.rb:24:in `call' rack (2.2.3) lib/rack/runtime.rb:22:in `call' activesupport (6.0.3) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' actionpack (6.0.3) lib/action_dispatch/middleware/executor.rb:14:in `call' actionpack (6.0.3) lib/action_dispatch/middleware/static.rb:126:in `call' rack (2.2.3) lib/rack/sendfile.rb:110:in `call' actionpack (6.0.3) lib/action_dispatch/middleware/host_authorization.rb:76:in `call' webpacker (4.0.7) lib/webpacker/dev_server_proxy.rb:29:in `perform_request' rack-proxy (0.6.5) lib/rack/proxy.rb:57:in `call' railties (6.0.3) lib/rails/engine.rb:527:in `call' puma (4.3.6) lib/puma/configuration.rb:228:in `call' puma (4.3.6) lib/puma/server.rb:713:in `handle_request' puma (4.3.6) lib/puma/server.rb:472:in `process_client' puma (4.3.6) lib/puma/server.rb:328:in `block in run' puma (4.3.6) lib/puma/thread_pool.rb:134:in `block in spawn_thread'

試したこと

まず rails db:migrateでしたのですが画面は変わらず、次に rails db:migrate RAILS_ENV=developmentを
しましたが変わらず、rails db:reset rails db:migrateをしてもエラー画面は変らずです。他の人の質問箱を見てやって見ましたが、どれも無理でした。
ご教授願いますでしょうか。
宜しくお願いいたします。

補足情報(FW/ツールのバージョンなど)

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

winterboum

2021/03/15 07:52

migationに失敗しているのでは? 実行結果を載せてください
yoshi-00

2021/03/16 20:26

コメントありがとうございます。エラー画像添付しています。 rails generate migration クラス名で次にrails generate model モデル名を入力しました。 その後にrake db:migrateでrake db:rollbackを行いました。それでもエラー画面のままです。。
winterboum

2021/03/16 22:34

ですから 「migationに失敗しているのでは? 実行結果を載せてください」 rails db:migrate の実行結果!
yoshi-00

2021/03/20 16:00 編集

初心者すぎてすいません。 実行結果です。 == 20210314154212 CreateMicroposts: migrating ================================= -- create_table(:microposts) rails aborted! StandardError: An error has occurred, this and all later migrations canceled: undefined method `intege' for #<ActiveRecord::ConnectionAdapters::SQLite3::TableDefinition:0x0000564050b4ab18> Did you mean? integer /home/ubuntu/environment/toy_app/db/migrate/20210314154212_create_microposts.rb:5:in `block in change' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:309:in `create_table' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:890:in `block in method_missing' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:858:in `block in say_with_time' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:858:in `say_with_time' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:879:in `method_missing' /home/ubuntu/environment/toy_app/db/migrate/20210314154212_create_microposts.rb:3:in `change' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:828:in `exec_migration' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:812:in `block (2 levels) in migrate' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:811:in `block in migrate' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:471:in `with_connection' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:810:in `migrate' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1002:in `migrate' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1310:in `block in execute_migration_in_transaction' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1361:in `block in ddl_transaction' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `block in transaction' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_transaction' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/connection_adapters/abstract/transaction.rb:278:in `within_new_transaction' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `transaction' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/transactions.rb:212:in `transaction' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1361:in `ddl_transaction' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1309:in `execute_migration_in_transaction' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1281:in `block in migrate_without_lock' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1280:in `each' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1280:in `migrate_without_lock' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1231:in `migrate' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1061:in `up' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1036:in `migrate' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/tasks/database_tasks.rb:238:in `migrate' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/railties/databases.rake:86:in `block (3 levels) in <main>' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/railties/databases.rake:84:in `each' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/railties/databases.rake:84:in `block (2 levels) in <main>' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/commands/rake/rake_command.rb:23:in `block in perform' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/commands/rake/rake_command.rb:20:in `perform' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/command.rb:48:in `invoke' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/commands.rb:18:in `<main>' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/dependencies.rb:324:in `block in require' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/dependencies.rb:291:in `load_dependency' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/dependencies.rb:324:in `require' /home/ubuntu/environment/toy_app/bin/rails:9:in `<top (required)>' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client.rb:30:in `run' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/bin/spring:49:in `<top (required)>' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>' /home/ubuntu/environment/toy_app/bin/spring:15:in `require' /home/ubuntu/environment/toy_app/bin/spring:15:in `<top (required)>' bin/rails:3:in `load' bin/rails:3:in `<main>'
yoshi-00

2021/03/20 15:55

Caused by: NoMethodError: undefined method `intege' for #<ActiveRecord::ConnectionAdapters::SQLite3::TableDefinition:0x0000564050b4ab18> Did you mean? integer /home/ubuntu/environment/toy_app/db/migrate/20210314154212_create_microposts.rb:5:in `block in change' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:309:in `create_table' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:890:in `block in method_missing' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:858:in `block in say_with_time' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:858:in `say_with_time' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:879:in `method_missing' /home/ubuntu/environment/toy_app/db/migrate/20210314154212_create_microposts.rb:3:in `change' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:828:in `exec_migration' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:812:in `block (2 levels) in migrate' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:811:in `block in migrate' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:471:in `with_connection' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:810:in `migrate' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1002:in `migrate' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1310:in `block in execute_migration_in_transaction' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1361:in `block in ddl_transaction' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `block in transaction' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_transaction' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/activ
guest

回答1

0

ベストアンサー

20210314154212 CreateMicroposts: migrating にて
undefined method intege' for #`
が出ています。
integer の typoでは?

投稿2021/03/20 23:22

winterboum

総合スコア23567

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

yoshi-00

2021/03/21 07:14

integeとなっていたので書き直して保存しました。 これで立ち上がるかと思いやってみましたが、またエラーが発生していまいました。 rails db:migrateするとTypeError: ToyApp is not a classとエラーが出てきてしまいました。 TypeError: ToyApp is not a class /home/ubuntu/environment/toy_app/db/migrate/20210316201145_toy_app.rb:1:in `<main>' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1010:in `load_migration' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1006:in `migration' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1002:in `disable_ddl_transaction' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1368:in `use_transaction?' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1315:in `rescue in execute_migration_in_transaction' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1303:in `execute_migration_in_transaction' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1281:in `block in migrate_without_lock' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1280:in `each' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1280:in `migrate_without_lock' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1231:in `migrate' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1061:in `up' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1036:in `migrate' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/tasks/database_tasks.rb:238:in `migrate' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/railties/databases.rake:86:in `block (3 levels) in <main>' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/railties/databases.rake:84:in `each' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/railties/databases.rake:84:in `block (2 levels) in <main>' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/commands/rake/rake_command.rb:23:in `block in perform' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/commands/rake/rake_command.rb:20:in `perform' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/command.rb:48:in `invoke' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/commands.rb:18:in `<main>' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/dependencies.rb:324:in `block in require' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/dependencies.rb:291:in `load_dependency' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/dependencies.rb:324:in `require' /home/ubuntu/environment/toy_app/bin/rails:9:in `<top (required)>' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client.rb:30:in `run' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/bin/spring:49:in `<top (required)>' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>' /home/ubuntu/environment/toy_app/bin/spring:15:in `require' /home/ubuntu/environment/toy_app/bin/spring:15:in `<top (required)>' bin/rails:3:in `load' bin/rails:3:in `<main>'
yoshi-00

2021/03/21 07:14

Caused by: TypeError: ToyApp is not a class /home/ubuntu/environment/toy_app/db/migrate/20210316201145_toy_app.rb:1:in `<main>' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1010:in `load_migration' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1006:in `migration' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1002:in `disable_ddl_transaction' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1368:in `use_transaction?' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1360:in `ddl_transaction' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1309:in `execute_migration_in_transaction' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1281:in `block in migrate_without_lock' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1280:in `each' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1280:in `migrate_without_lock' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1231:in `migrate' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1061:in `up' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/migration.rb:1036:in `migrate' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/tasks/database_tasks.rb:238:in `migrate' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/railties/databases.rake:86:in `block (3 levels) in <main>' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/railties/databases.rake:84:in `each' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-6.0.3/lib/active_record/railties/databases.rake:84:in `block (2 levels) in <main>' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/commands/rake/rake_command.rb:23:in `block in perform' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/commands/rake/rake_command.rb:20:in `perform' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/command.rb:48:in `invoke' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/commands.rb:18:in `<main>' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/dependencies.rb:324:in `block in require' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/dependencies.rb:291:in `load_dependency' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/dependencies.rb:324:in `require' /home/ubuntu/environment/toy_app/bin/rails:9:in `<top (required)>' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client.rb:30:in `run' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/bin/spring:49:in `<top (required)>' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load' /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>' /home/ubuntu/environment/toy_app/bin/spring:15:in `require' /home/ubuntu/environment/toy_app/bin/spring:15:in `<top (required)>' bin/rails:3:in `load' bin/rails:3:in `<main>' Tasks: TOP => db:migrate (See full trace by running task with --trace)
winterboum

2021/03/21 07:46

db/migrate/20210316201145_toy_app.rb の中身は
yoshi-00

2021/03/21 08:27

class ToyApp < ActiveRecord::Migration[6.0] def change end end になります。
winterboum

2021/03/21 09:29

はて、、、、 空だからかなぁ、、、 空で良いならなくて良いので削除してやってみて
yoshi-00

2021/03/21 09:43

削除したらおかげさまで無事サーバー立ち上がりました! とりあえずこの状態で勉強進めていきます。 ありがとうございました感謝です!!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.36%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問