githubからcloneしたプロジェクトをローカル環境で再開発と勉強をしたいと考えています。
その際、データベースを構築する上でmigrationファイルを参照してデータベースを作成する必要があるのですが、そのコマンドを実行したところ、このようなエラーが出ました。
command
1$rails db:migrate 2 3rails aborted! 4NoMethodError: Cannot load database configuration: 5undefined method `each' for "u#MySQL. Versions 5.1.10 and up are supported.":String 6/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.2/lib/rails/application/configuration.rb:175:in `database_configuration' 7/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.2/lib/active_record/railtie.rb:39:in `block (3 levels) in <class:Railtie>' 8/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.2/lib/rails/commands/rake/rake_command.rb:23:in `block in perform' 9/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.2/lib/rails/commands/rake/rake_command.rb:20:in `perform' 10/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.2/lib/rails/command.rb:48:in `invoke' 11/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.2/lib/rails/commands.rb:18:in `<main>' 12/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' 13/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' 14/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' 15/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' 16/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' 17/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:291:in `block in require' 18/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:257:in `load_dependency' 19/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:291:in `require' 20/Users/user/rails_workspace/tasklist/bin/rails:9:in `<top (required)>' 21/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load' 22/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call' 23/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call' 24/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/spring-2.1.0/lib/spring/client.rb:30:in `run' 25/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/spring-2.1.0/bin/spring:49:in `<top (required)>' 26/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load' 27/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>' 28/Users/user/rails_workspace/tasklist/bin/spring:15:in `<top (required)>' 29bin/rails:3:in `load' 30bin/rails:3:in `<main>' 31 32Caused by: 33NoMethodError: undefined method `each' for "u#MySQL. Versions 5.1.10 and up are supported.":String 34/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.2/lib/rails/application/configuration.rb:175:in `database_configuration' 35/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.2/lib/active_record/railtie.rb:39:in `block (3 levels) in <class:Railtie>' 36/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.2/lib/rails/commands/rake/rake_command.rb:23:in `block in perform' 37/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.2/lib/rails/commands/rake/rake_command.rb:20:in `perform' 38/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.2/lib/rails/command.rb:48:in `invoke' 39/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.2/lib/rails/commands.rb:18:in `<main>' 40/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' 41/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' 42/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' 43/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' 44/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' 45/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:291:in `block in require' 46/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:257:in `load_dependency' 47/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:291:in `require' 48/Users/user/rails_workspace/tasklist/bin/rails:9:in `<top (required)>' 49/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load' 50/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call' 51/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call' 52/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/spring-2.1.0/lib/spring/client.rb:30:in `run' 53/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/spring-2.1.0/bin/spring:49:in `<top (required)>' 54/Users/user/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load' 55/Users/usera/rails_workspace/tasklist/vendor/bundle/ruby/2.6.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>' 56/Users/user/rails_workspace/tasklist/bin/spring:15:in `<top (required)>' 57bin/rails:3:in `load' 58bin/rails:3:in `<main>' 59Tasks: TOP => db:migrate => db:load_config 60(See full trace by running task with --trace) 61
使用しているもののバージョンです。
- Rails 5.2.4.2
- mysql Ver 8.0.21 for osx10.15 on x86_64 (Homebrew)
- ruby 2.6.6 (set by /Users/user/rails_workspace/tasklist/.ruby-version)
いろいろ調べてみましたが、解決できる見通しが立ちません・・・
よろしくお願いいたします。
また、エラーの見方が全くわかりませんので、併せてご教示いただければ幸いです。
回答1件
あなたの回答
tips
プレビュー