uninitialized constant ActionController::InvalidAuthenticityToken (NameError) at server restart after installing react-rails
I am installing gem 'react-rails' on the project already using gem 'webpacker', '~> 4.0.0.pre'. I want to achieve react_component rendering functionality in the rails view which seems not to be included directly in webpacker:react
After bundle install I am getting
uninitialized constant ActionController::InvalidAuthenticityToken (NameError)
error on all rails command in the terminal rails c rails s rails generate react:install # for configuring newly installed react-rails gem ....
here are the error logs
Booting Puma => Rails 5.2.3 application starting in development => Run
rails server -hfor more startup options Exiting Traceback (most recent call last): 78: from bin/rails:3:in<main>' 77: from bin/rails:3:inload' 76: from /home/user/Project/mxt/bin/spring:15:in<top (required)>' 75: from /home/user/Project/mxt/bin/spring:15:inrequire' 74: from /home/user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/binstub.rb:31:in<top (required)>' 73: from /home/user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/binstub.rb:31:inload' 72: from /home/user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/bin/spring:49:in<top (required)>' 71: from /home/user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/client.rb:30:inrun' 70: from /home/user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/client/command.rb:7:incall' 69: from /home/user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/client/rails.rb:28:incall' 68: from /home/user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/client/rails.rb:28:inload' 67: from /home/user/Project/mxt/bin/rails:9:in<top (required)>' 66: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:inrequire' 65: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:inrequire_with_bootsnap_lfi' 64: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:inregister' 63: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:inblock in require_with_bootsnap_lfi' 62: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:inrequire' 61: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands.rb:18:in' 60: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/command.rb:46:in invoke' 59: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/command/base.rb:65:inperform' 58: from /home/user/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor.rb:387:indispatch' 57: from /home/user/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/invocation.rb:126:ininvoke_command' 56: from /home/user/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/command.rb:27:inrun' 55: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:inperform' 54: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:intap' 53: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:147:inblock in perform' 52: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:51:instart' 51: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:89:inlog_to_stdout' 50: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/server.rb:422:inwrapped_app' 49: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:27:inapp' 48: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/server.rb:249:inapp' 47: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/server.rb:349:inbuild_app_and_options_from_config' 46: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/builder.rb:66:inparse_file' 45: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/builder.rb:105:inload_file' 44: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/builder.rb:116:innew_from_string' 43: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/builder.rb:116:ineval' 42: from config.ru:3:inblock in <main>' 41: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:48:inrequire_relative' 40: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:inrequire' 39: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:inrequire_with_bootsnap_lfi' 38: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:inregister' 37: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:inblock in require_with_bootsnap_lfi' 36: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:inrequire' 35: from /home/user/Project/mxt/config/environment.rb:5:in' 34: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/application.rb:361:in initialize!' 33: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:60:inrun_initializers' 32: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:205:intsort_each' 31: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:226:intsort_each' 30: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:ineach_strongly_connected_component' 29: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:incall' 28: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:ineach' 27: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:349:inblock in each_strongly_connected_component' 26: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:415:ineach_strongly_connected_component_from' 25: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:415:incall' 24: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:50:intsort_each_child' 23: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:50:ineach' 22: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:421:inblock in each_strongly_connected_component_from' 21: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:431:ineach_strongly_connected_component_from' 20: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:422:inblock (2 levels) in each_strongly_connected_component_from' 19: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:350:inblock (2 levels) in each_strongly_connected_component' 18: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:228:inblock in tsort_each' 17: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:61:inblock in run_initializers' 16: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:32:inrun' 15: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:32:ininstance_exec' 14: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/engine.rb:613:inblock in <class:Engine>' 13: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/engine.rb:613:ineach' 12: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/engine.rb:614:inblock (2 levels) in <class:Engine>' 11: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/engine.rb:656:inload_config_initializer' 10: from /home/user/.rvm/gems/ruby-2.6.3/gems/activesupport-5.2.3/lib/active_support/notifications.rb:170:ininstrument' 9: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/engine.rb:657:inblock in load_config_initializer' 8: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:inload' 7: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:inload' 6: from /home/user/Project/mxt/config/initializers/sentry.rb:1:in<main>' 5: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/forwardable.rb:230:inconfigure' 4: from /home/user/.rvm/gems/ruby-2.6.3/gems/sentry-raven-2.9.0/lib/raven/instance.rb:68:inconfigure' 3: from /home/user/Project/mxt/config/initializers/sentry.rb:6:inblock in' 2: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/active_support.rb:59:in load_missing_constant' 1: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:inallow_bootsnap_retry' /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/active_support.rb:60:inblock in load_missing_constant': uninitialized constant ActionController::InvalidAuthenticityToken (NameError) 79: from bin/rails:3:in' 78: from bin/rails:3:in load' 77: from /home/user/Project/mxt/bin/spring:15:in<top (required)>' 76: from /home/user/Project/mxt/bin/spring:15:inrequire' 75: from /home/user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/binstub.rb:31:in<top (required)>' 74: from /home/user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/binstub.rb:31:inload' 73: from /home/user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/bin/spring:49:in<top (required)>' 72: from /home/user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/client.rb:30:inrun' 71: from /home/user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/client/command.rb:7:incall' 70: from /home/user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/client/rails.rb:28:incall' 69: from /home/user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/client/rails.rb:28:inload' 68: from /home/user/Project/mxt/bin/rails:9:in<top (required)>' 67: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:inrequire' 66: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:inrequire_with_bootsnap_lfi' 65: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:inregister' 64: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:inblock in require_with_bootsnap_lfi' 63: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:inrequire' 62: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands.rb:18:in<main>' 61: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/command.rb:46:ininvoke' 60: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/command/base.rb:65:inperform' 59: from /home/user/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor.rb:387:indispatch' 58: from /home/user/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/invocation.rb:126:ininvoke_command' 57: from /home/user/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/command.rb:27:inrun' 56: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:inperform' 55: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:intap' 54: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:147:inblock in perform' 53: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:51:instart' 52: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:89:inlog_to_stdout' 51: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/server.rb:422:inwrapped_app' 50: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:27:inapp' 49: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/server.rb:249:inapp' 48: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/server.rb:349:inbuild_app_and_options_from_config' 47: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/builder.rb:66:inparse_file' 46: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/builder.rb:105:inload_file' 45: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/builder.rb:116:innew_from_string' 44: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/builder.rb:116:ineval' 43: from config.ru:3:inblock in' 42: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:48:in require_relative' 41: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:inrequire' 40: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:inrequire_with_bootsnap_lfi' 39: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:inregister' 38: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:inblock in require_with_bootsnap_lfi' 37: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:inrequire' 36: from /home/user/Project/mxt/config/environment.rb:5:in<main>' 35: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/application.rb:361:ininitialize!' 34: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:60:inrun_initializers' 33: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:205:intsort_each' 32: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:226:intsort_each' 31: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:ineach_strongly_connected_component' 30: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:incall' 29: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:ineach' 28: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:349:inblock in each_strongly_connected_component' 27: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:415:ineach_strongly_connected_component_from' 26: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:415:incall' 25: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:50:intsort_each_child' 24: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:50:ineach' 23: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:421:inblock in each_strongly_connected_component_from' 22: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:431:ineach_strongly_connected_component_from' 21: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:422:inblock (2 levels) in each_strongly_connected_component_from' 20: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:350:inblock (2 levels) in each_strongly_connected_component' 19: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:228:inblock in tsort_each' 18: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:61:inblock in run_initializers' 17: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:32:inrun' 16: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:32:ininstance_exec' 15: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/engine.rb:613:inblock in class:Engine' 14: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/engine.rb:613:ineach' 13: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/engine.rb:614:inblock (2 levels) in class:Engine' 12: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/engine.rb:656:inload_config_initializer' 11: from /home/user/.rvm/gems/ruby-2.6.3/gems/activesupport-5.2.3/lib/active_support/notifications.rb:170:ininstrument' 10: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/engine.rb:657:inblock in load_config_initializer' 9: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:inload' 8: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:inload' 7: from /home/user/Project/mxt/config/initializers/sentry.rb:1:in' 6: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/forwardable.rb:230:in configure' 5: from /home/user/.rvm/gems/ruby-2.6.3/gems/sentry-raven-2.9.0/lib/raven/instance.rb:68:inconfigure' 4: from /home/user/Project/mxt/config/initializers/sentry.rb:6:inblock in <main>' 3: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/active_support.rb:58:inload_missing_constant' 2: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/active_support.rb:79:inrescue in load_missing_constant' 1: from /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/active_support.rb:8:inwithout_bootsnap_cache' /home/user/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/active_support.rb:79:in `block in load_missing_constant': uninitialized constant ActionController::InvalidAuthenticityToken (NameError)