環境
Ruby 2.6.3
Rails 5.2.4.1
初学者
ローカル
Mac
やろうとしていること
$rails test
エラーが出ています。
posts_controller_test.rb
require 'test_helper' class PostsControllerTest < ActionDispatch::IntegrationTest test "should get home" do get static_pages_home_url assert_response :success end test "should get help" do get static_pages_help_url assert_response :success end test "should get about" do get static_pages_about_url assert_response :success end end
エラー内容
rails test Running via Spring preloader in process 35038 Traceback (most recent call last): 30: from -e:1:in `<main>' 29: from /Users/hoge/.rbenv/versions/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' 28: from /Users/hoge/.rbenv/versions/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' 27: from /Users/hoge/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load' 26: from /Users/hoge/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load' 25: from /Users/hoge/hikimy/bin/rails:9:in `<main>' 24: from /Users/hoge/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' 23: from /Users/hoge/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' 22: from /Users/hoge/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' 21: from /Users/hoge/.rbenv/versions/2.6.3/lib/ruby/gems/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' 20: from /Users/hoge/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap- . . .途中割愛(文字数オーバーのため) . . `without_bootsnap_cache' /Users/hoge/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/active_support.rb:80:in `block in load_missing_constant': uninitialized constant ActionCable::Connection::TestCase (NameError)
試したこと
-
Running via Spring preloader in process を調べたが不明
-
uninitialized constant ActionCable::Connection::TestCase (NameError)を調べたが不明
-
uninitialized constant「定義したクラスを読むことができない」
-
springを一度全て止めて見る→効果なし
ps aux | grep spring
kill -9
- kernel_require.rb:72:in `require'を調べて同じようにいくつか試したが解決せず。
仮説
- rails6 から5にバージョンダウンしたから?
- .rbenv/versions/2.6.3/lib/ruby/site_ruby/2.6.0 この辺を削除して再インストールすればいいのか?
- testの書き方が間違っている?
最後に
原因がまったくつかめておりません。
アドバイスお願い申し上げます。
あなたの回答
tips
プレビュー