前提・実現したいこと
今回初め質問します。拙い文章で分りにくいかもしれませんがご教授願います。
~実行環境~
Rails version 5.1.6
Ruby version 2.6.5-p114 (x64-mingw32)
RubyGems version 3.1.2
発生している問題・エラーメッセージ
Railsチュートリアル2章で初めてマイグレートする際にこのようなエラーが起きます。
PS C:\Users\username\environment\toy_app> rails db:migrate rails aborted! ArgumentError: wrong number of arguments (given 2, expected 0) bin/rails:4:in `require' bin/rails:4:in `<main>' Tasks: TOP => db:migrate (See full trace by running task with --trace)
リスト 2.4を実行するまでは基本的に記載された通り進めました。
途中rails sをする際にsqlite3_nativeがないとエラーが起きたため
「rails s」で「sqlite3/sqlite3_native」が出た時の対処法
この記事を参考にさせて頂いたところ問題解決しました。
試したこと
3,4回ほどやり直してもエラー文は特に変わりませんでした。また、
$ rails db:version $ rails db:charset $ rails db:create etc...
上のコマンドを入力したところ
rails aborted! ArgumentError: wrong number of arguments (given 2, expected 0) bin/rails:4:in `require' bin/rails:4:in `<main>'
どのコマンドもこのエラーが出ます。
また使用しているDBはsqlite3を使用しておりrails dbconsoleをするとコンソールは開きます。
補足情報
rails db:migrate --traceした結果です。
PS C:\Users\username\environment\toy_app> rails db:migrate --trace ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Invoke db:load_config (first_time) ** Execute db:load_config ** Execute db:migrate rails aborted! ArgumentError: wrong number of arguments (given 2, expected 0) C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/sqlite3_adapter.rb:30:in `initialize' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/sqlite3_adapter.rb:30:in `new' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/sqlite3_adapter.rb:30:in `sqlite3_connection' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:759:in `new_connection' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:803:in `checkout_new_connection' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:782:in `try_to_checkout_new_connection' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:743:in `acquire_connection' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:500:in `checkout' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in `connection' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:931:in `retrieve_connection' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-5.1.6/lib/active_record/connection_handling.rb:116:in `retrieve_connection' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-5.1.6/lib/active_record/connection_handling.rb:88:in `connection' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-5.1.6/lib/active_record/schema_migration.rb:20:in `table_exists?' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-5.1.6/lib/active_record/schema_migration.rb:24:in `create_table' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1125:in `initialize' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1007:in `new' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1007:in `up' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:985:in `migrate' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-5.1.6/lib/active_record/tasks/database_tasks.rb:171:in `migrate' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activerecord-5.1.6/lib/active_record/railties/databases.rake:58:in `block (2 levels) in <top (required)>' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `block in execute' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `each' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `execute' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain' C:/Ruby26-x64/lib/ruby/2.6.0/monitor.rb:235:in `mon_synchronize' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:188:in `invoke' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:160:in `invoke_task' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `block (2 levels) in top_level' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `each' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `block in top_level' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:125:in `run_with_threads' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:110:in `top_level' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.1.6/lib/rails/commands/rake/rake_command.rb:21:in `block in perform' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.1.6/lib/rails/commands/rake/rake_command.rb:18:in `perform' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.1.6/lib/rails/command.rb:46:in `invoke' C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.1.6/lib/rails/commands.rb:16:in `<top (required)>' bin/rails:4:in `require' bin/rails:4:in `<main>' Tasks: TOP => db:migrate
たくさんの記事を見て調べましたが、ごく稀に似たようなエラーが起きている人はいても解決までたどり着いている記事がなくRails初学者である私にとっては手に余る状態です。もしお分かりなる方がいらっしゃれば知恵を貸して頂ければ幸いです。