午前中までは普通に動いていたのですが、急に rails s をすると以下のようなエラーが出るようになりました。
Exiting Traceback (most recent call last): 58: from bin/rails:3:in `<main>' 57: from bin/rails:3:in `load' 56: from /performance_review/bin/spring:15:in `<top (required)>' 55: from /usr/local/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' 54: from /usr/local/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' 53: from /usr/local/bundle/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>' 52: from /usr/local/bundle/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load' 51: from /usr/local/bundle/gems/spring-2.1.0/bin/spring:49:in `<top (required)>' 50: from /usr/local/bundle/gems/spring-2.1.0/lib/spring/client.rb:30:in `run' 49: from /usr/local/bundle/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call' 48: from /usr/local/bundle/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call' 47: from /usr/local/bundle/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load' 46: from /performance_review/bin/rails:9:in `<top (required)>' 45: from /performance_review/bin/rails:9:in `require' 44: from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/commands.rb:18:in `<top (required)>' 43: from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/command.rb:46:in `invoke' 42: from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/command/base.rb:69:in `perform' 41: from /usr/local/bundle/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch' 40: from /usr/local/bundle/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command' 39: from /usr/local/bundle/gems/thor-1.0.1/lib/thor/command.rb:27:in `run' 38: from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/commands/server/server_command.rb:138:in `perform' 37: from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/commands/server/server_command.rb:138:in `tap' 36: from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/commands/server/server_command.rb:147:in `block in perform' 35: from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/commands/server/server_command.rb:37:in `start' 34: from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/commands/server/server_command.rb:77:in `log_to_stdout' 33: from /usr/local/bundle/gems/rack-2.0.8/lib/rack/server.rb:354:in `wrapped_app' 32: from /usr/local/bundle/gems/rack-2.0.8/lib/rack/server.rb:219:in `app' 31: from /usr/local/bundle/gems/rack-2.0.8/lib/rack/server.rb:319:in `build_app_and_options_from_config' 30: from /usr/local/bundle/gems/rack-2.0.8/lib/rack/builder.rb:40:in `parse_file' 29: from /usr/local/bundle/gems/rack-2.0.8/lib/rack/builder.rb:49:in `new_from_string' 28: from /usr/local/bundle/gems/rack-2.0.8/lib/rack/builder.rb:49:in `eval' 27: from config.ru:in `<main>' 26: from config.ru:in `new' 25: from /usr/local/bundle/gems/rack-2.0.8/lib/rack/builder.rb:55:in `initialize' 24: from /usr/local/bundle/gems/rack-2.0.8/lib/rack/builder.rb:55:in `instance_eval' 23: from config.ru:3:in `block in <main>' 22: from config.ru:3:in `require_relative' 21: from /performance_review/config/environment.rb:5:in `<top (required)>' 20: from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/application.rb:363:in `initialize!' 19: from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/initializable.rb:60:in `run_initializers' 18: from /usr/local/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each' 17: from /usr/local/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each' 16: from /usr/local/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component' 15: from /usr/local/lib/ruby/2.6.0/tsort.rb:347:in `call' 14: from /usr/local/lib/ruby/2.6.0/tsort.rb:347:in `each' 13: from /usr/local/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component' 12: from /usr/local/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from' 11: from /usr/local/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component' 10: from /usr/local/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each' 9: from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/initializable.rb:61:in `block in run_initializers' 8: from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/initializable.rb:32:in `run' 7: from /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/initializable.rb:32:in `instance_exec' 6: from /usr/local/bundle/gems/webpacker-4.2.2/lib/webpacker/railtie.rb:84:in `block in <class:Engine>' 5: from /usr/local/bundle/gems/webpacker-4.2.2/lib/webpacker.rb:35:in `bootstrap' 4: from /usr/local/bundle/gems/webpacker-4.2.2/lib/webpacker/commands.rb:25:in `bootstrap' 3: from /usr/local/bundle/gems/webpacker-4.2.2/lib/webpacker/manifest.rb:18:in `refresh' 2: from /usr/local/bundle/gems/webpacker-4.2.2/lib/webpacker/manifest.rb:84:in `load' 1: from /usr/local/lib/ruby/2.6.0/json/common.rb:156:in `parse' /usr/local/lib/ruby/2.6.0/json/common.rb:156:in `parse': 767: unexpected token at '' (JSON::ParserError)
試したこと
spring stop
後rails s
⇒ エラー変わらずGemfile
の bootsnapとconfig/boot.rb
の # require 'bootsnap/setup' # Speed up boot time by caching expensive operations. を コメントアウト→bundle install
→rails s
:エラー変わらず- PC再起動: エラー変わらず
の状態です。
もし、他に試せそうなことがあればご教授よろしくお願いします。
追記
試したことの前に、エラーになる前のソースまで戻してから実施しています。
最初にやるべきことは
最後に動いた時から動かないことがわかった最初の時の間に何をしたのか、を思い出すこと。
場合に依っては、
最後に起動出来た時から かもしれないですが
すみません。
記載してはいませんが `git stash` で動いていた時の時点には戻しています。
codeは戻っているかもしれませんが、それでは戻らないことをしてません?
rails を起動中にVue.jsで作成しているcomponentファイルのディレクトリ構造を変更しました。
webpack-dev-serverで自動コンパイルしているので、ファイル名などを変えた場合にコンパイルが失敗するため、webpack-dev-serverのみ再起動してコンパイルさせました。それでもおかしかったので、railsも止めて、再起動させました。
すると起動できずにこの投稿のエラーになりました。
なので、ソースを全て戻しました。
特に、railsやwebpack側の設定を変えてはいません。