Error spring - Ruby on Rails 5

Asked

Viewed 139 times

0

I’m following this tutorial Cocoon: Easily create dynamic Forms in Rails on dynamic Forms using Gem Cocoon, but trying to test code running 'Rails' appears several errors related to spring. Has anyone gone through this and managed to find a solution? Follow below the mistakes:

Traceback (most recent call last):
    74: from bin/rails:3:in `<main>'
    73: from bin/rails:3:in `load'
    72: from /home/kaio/Documents/Rails/Testes/users_register/bin/spring:15:in `<top (required)>'
    71: from /home/kaio/Documents/Rails/Testes/users_register/bin/spring:15:in `require'
    70: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
    69: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
    68: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
    67: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
    66: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
    65: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
    64: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
    63: from /home/kaio/Documents/Rails/Testes/users_register/bin/rails:9:in `<top (required)>'
    62: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
    61: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
    60: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
    59: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    58: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
    57: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    56: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
    55: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
    54: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<main>'
    53: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/railties-5.2.3/lib/rails/command.rb:46:in `invoke'
    52: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/railties-5.2.3/lib/rails/command/base.rb:65:in `perform'
    51: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
    50: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
    49: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
    48: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in `perform'
    47: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in `tap'
    46: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:147:in `block in perform'
    45: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:51:in `start'
    44: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:89:in `log_to_stdout'
    43: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/server.rb:354:in `wrapped_app'
    42: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:27:in `app'
    41: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/server.rb:219:in `app'
    40: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/server.rb:319:in `build_app_and_options_from_config'
    39: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:40:in `parse_file'
    38: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:49:in `new_from_string'
    37: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:49:in `eval'
    36: from config.ru:in `<main>'
    35: from config.ru:in `new'
    34: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:55:in `initialize'
    33: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:55:in `instance_eval'
    32: from config.ru:3:in `block in <main>'
    31: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:48:in `require_relative'
    30: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
    29: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
    28: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
    27: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    26: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
    25: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    24: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
    23: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
    22: from /home/kaio/Documents/Rails/Testes/users_register/config/environment.rb:5:in `<main>'
    21: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/railties-5.2.3/lib/rails/application.rb:361:in `initialize!'
    20: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:60:in `run_initializers'
    19: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each'
    18: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each'
    17: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component'
    16: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:347:in `call'
    15: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:347:in `each'
    14: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component'
    13: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from'
    12: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
    11: from /usr/share/rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each'
    10: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:61:in `block in run_initializers'
     9: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `run'
     8: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `instance_exec'
     7: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/railties-5.2.3/lib/rails/application/bootstrap.rb:81:in `block in <module:Bootstrap>'
     6: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
     5: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:51:in `each'
     4: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
     3: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
     2: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
     1: from /home/kaio/.rvm/gems/ruby-2.6.0/gems/activesupport-5.2.3/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook'
/home/kaio/.rvm/gems/ruby-2.6.0/gems/cocoon-1.1.2/lib/cocoon.rb:7:in `block in <class:Engine>': undefined method `[]=' for nil:NilClass (NoMethodError)
  • 1

    I don’t know Ruby, but languages in general, no code is hard to say

1 answer

1

Spring appears because rails s is running through spring. But the error has nothing to do with spring.

Note that the traceback is in reverse order, meaning the original error is well down:

/home/kaio/.rvm/gems/ruby-2.6.0/gems/cocoon-1.1.2/lib/cocoon.rb:7:in `block in <class:Engine>': undefined method `[]=' for nil:NilClass (NoMethodError)

This error indicates that you are trying something the way

x[y] = val

whereas x is nil.

  • ok, thanks for the answer. I’ll take a look, but I followed the tutorial correctly and in mine gives this error. Maybe it’s the Ruby version...

  • You could accept my answer?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.