前提・実現したいこと
Railsチュートリアル3章の最初のテストでエラーが出ます。
バージョン情報
Windows10
ruby 2.5.1p57
Rails 5.1.6
発生している問題・エラーメッセージ
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/sqlite3_adapter.rb:30:in `initialize': wrong number of arguments (given 2, expected 0) (ArgumentError)
該当のソースコード
C:\Users\shohe\rubybook\sample_app>rails t Traceback (most recent call last): 39: from bin/rails:4:in `<main>' 38: from bin/rails:4:in `require' 37: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/commands.rb:16:in `<top (required)>' 36: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/command.rb:44:in `invoke' 35: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/command/base.rb:63:in `perform' 34: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch' 33: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command' 32: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run' 31: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/commands/test/test_command.rb:38:in `perform' 30: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/test_unit/runner.rb:39:in `run' 29: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/test_unit/runner.rb:50:in `load_tests' 28: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/test_unit/runner.rb:50:in `each' 27: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/test_unit/runner.rb:50:in `block in load_tests' 26: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/test_unit/runner.rb:50:in `require' 25: from C:/Users/shohe/rubybook/sample_app/test/controllers/static_pages_controller_test.rb:1:in `<top (required)>' 24: from C:/Users/shohe/rubybook/sample_app/test/controllers/static_pages_controller_test.rb:1:in `require' 23: from C:/Users/shohe/rubybook/sample_app/test/test_helper.rb:3:in `<top (required)>' 22: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require' 21: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency' 20: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require' 19: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require' 18: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/test_help.rb:15:in `<top (required)>' 17: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:595:in `maintain_test_schema!' 16: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:600:in `method_missing' 15: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:826:in `suppress_messages' 14: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:595:in `block in maintain_test_schema!' 13: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:580:in `load_schema_if_pending!' 12: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/migration.rb:1042:in `needs_migration?' 11: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/connection_handling.rb:88:in `connection' 10: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/connection_handling.rb:116:in `retrieve_connection' 9: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:931:in `retrieve_connection' 8: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in `connection' 7: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:500:in `checkout' 6: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:743:in `acquire_connection' 5: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:782:in `try_to_checkout_new_connection' 4: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:803:in `checkout_new_connection' 3: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:759:in `new_connection' 2: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/sqlite3_adapter.rb:30:in `sqlite3_connection' 1: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/connection_adapters/sqlite3_adapter.rb:30:in `new'
Gemfile
source 'https://rubygems.org' git_source(:github) do |repo_name| repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") "https://github.com/#{repo_name}.git" end gem 'rails', '5.1.6' gem 'puma', '3.9.1' gem 'sass-rails', '5.0.6' gem 'uglifier', '3.2.0' gem 'coffee-rails', '4.2.2' gem 'jquery-rails', '4.3.1' gem 'turbolinks', '5.0.1' gem 'jbuilder', '2.7.0' group :development, :test do gem 'sqlite3' gem 'byebug', '9.0.6', platform: :mri end group :development do gem 'web-console', '3.5.1' gem 'listen', '3.1.5' gem 'spring', '2.0.2' gem 'spring-watcher-listen', '2.0.1' end group :test do gem 'rails-controller-testing', '1.0.2' gem 'minitest', '5.10.3' gem 'minitest-reporters', '1.1.14' gem 'guard', '2.13.0' gem 'guard-minitest', '2.4.4' end group :production do gem 'pg', '1.2.2' end # Windows環境ではtzinfo-dataというgemを含める必要があります gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] gem 'coffee-script-source', '1.8.0'
試したこと
初心者で自分で調べても何が問題か分かりませんでした。
・railsチュートリアル3章 ミニテスト
・wrong number of arguments (given 2, expected 0) (ArgumentError)
など調べてみたのですが・・・。
どうぞよろしくお願いします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。