react-rails icon indicating copy to clipboard operation
react-rails copied to clipboard

uninitialized constant ActionController::InvalidAuthenticityToken (NameError) at server restart after installing react-rails

Open HamzaShamshad opened this issue 4 years ago • 0 comments

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 -h for more startup options Exiting Traceback (most recent call last): 78: from bin/rails:3:in <main>' 77: from bin/rails:3:in load' 76: from /home/user/Project/mxt/bin/spring:15:in <top (required)>' 75: from /home/user/Project/mxt/bin/spring:15:in require' 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:in load' 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:in run' 70: from /home/user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/client/command.rb:7:in call' 69: from /home/user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in call' 68: from /home/user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in load' 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:in require' 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:in require_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:in register' 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:in block 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:in require' 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:in perform' 58: from /home/user/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor.rb:387:in dispatch' 57: from /home/user/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/invocation.rb:126:in invoke_command' 56: from /home/user/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/command.rb:27:in run' 55: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in perform' 54: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in tap' 53: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:147:in block 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:in start' 51: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:89:in log_to_stdout' 50: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/server.rb:422:in wrapped_app' 49: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:27:in app' 48: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/server.rb:249:in app' 47: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/server.rb:349:in build_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:in parse_file' 45: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/builder.rb:105:in load_file' 44: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/builder.rb:116:in new_from_string' 43: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/builder.rb:116:in eval' 42: from config.ru:3:in block 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:in require_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:in require' 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:in require_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:in register' 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:in block 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:in require' 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:in run_initializers' 32: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:205:in tsort_each' 31: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:226:in tsort_each' 30: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:in each_strongly_connected_component' 29: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:in call' 28: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:in each' 27: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:349:in block in each_strongly_connected_component' 26: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:415:in each_strongly_connected_component_from' 25: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:415:in call' 24: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:50:in tsort_each_child' 23: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:50:in each' 22: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:421:in block in each_strongly_connected_component_from' 21: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:431:in each_strongly_connected_component_from' 20: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:422:in block (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:in block (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:in block in tsort_each' 17: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:61:in block in run_initializers' 16: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:32:in run' 15: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:32:in instance_exec' 14: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/engine.rb:613:in block in <class:Engine>' 13: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/engine.rb:613:in each' 12: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/engine.rb:614:in block (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:in load_config_initializer' 10: from /home/user/.rvm/gems/ruby-2.6.3/gems/activesupport-5.2.3/lib/active_support/notifications.rb:170:in instrument' 9: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/engine.rb:657:in block 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:in load' 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:in load' 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:in configure' 4: from /home/user/.rvm/gems/ruby-2.6.3/gems/sentry-raven-2.9.0/lib/raven/instance.rb:68:in configure' 3: from /home/user/Project/mxt/config/initializers/sentry.rb:6:in block 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:in allow_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:in block 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:in require' 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:in load' 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:in run' 71: from /home/user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/client/command.rb:7:in call' 70: from /home/user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in call' 69: from /home/user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in load' 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:in require' 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:in require_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:in register' 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:in block 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:in require' 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:in invoke' 60: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/command/base.rb:65:in perform' 59: from /home/user/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor.rb:387:in dispatch' 58: from /home/user/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/invocation.rb:126:in invoke_command' 57: from /home/user/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/command.rb:27:in run' 56: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in perform' 55: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in tap' 54: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:147:in block 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:in start' 52: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:89:in log_to_stdout' 51: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/server.rb:422:in wrapped_app' 50: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:27:in app' 49: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/server.rb:249:in app' 48: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/server.rb:349:in build_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:in parse_file' 46: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/builder.rb:105:in load_file' 45: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/builder.rb:116:in new_from_string' 44: from /home/user/.rvm/gems/ruby-2.6.3/gems/rack-2.2.3/lib/rack/builder.rb:116:in eval' 43: from config.ru:3:in block 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:in require' 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:in require_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:in register' 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:in block 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:in require' 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:in initialize!' 34: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:60:in run_initializers' 33: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:205:in tsort_each' 32: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:226:in tsort_each' 31: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:in each_strongly_connected_component' 30: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:in call' 29: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:in each' 28: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:349:in block in each_strongly_connected_component' 27: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:415:in each_strongly_connected_component_from' 26: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:415:in call' 25: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:50:in tsort_each_child' 24: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:50:in each' 23: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:421:in block in each_strongly_connected_component_from' 22: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:431:in each_strongly_connected_component_from' 21: from /home/user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:422:in block (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:in block (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:in block in tsort_each' 18: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:61:in block in run_initializers' 17: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:32:in run' 16: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/initializable.rb:32:in instance_exec' 15: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/engine.rb:613:in block in class:Engine' 14: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/engine.rb:613:in each' 13: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/engine.rb:614:in block (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:in load_config_initializer' 11: from /home/user/.rvm/gems/ruby-2.6.3/gems/activesupport-5.2.3/lib/active_support/notifications.rb:170:in instrument' 10: from /home/user/.rvm/gems/ruby-2.6.3/gems/railties-5.2.3/lib/rails/engine.rb:657:in block 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:in load' 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:in load' 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:in configure' 4: from /home/user/Project/mxt/config/initializers/sentry.rb:6:in block 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:in load_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:in rescue 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:in without_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)

HamzaShamshad avatar Apr 26 '21 20:04 HamzaShamshad