新手问题 请教下,rucaptcha gem 报错

ghn645568344 · 2018年12月26日 · 最后由 ghn645568344 回复于 2018年12月26日 · 1039 次阅读

请教下大家,以前 rails 4 的时候玩过一次 rucaptcha,是好用的,最近升了 rails 升到 5.2.2,ruby2.5.3 后 rucaptcha 无法使用了,代码是按照 https://github.com/huacnlee/rucaptcha 配的 是因为版本不支持吗?还有其他好玩的验证码 gem 吗?请教😏

Exiting
Traceback (most recent call last):
    81: from bin/rails:4:in `<main>'
    80: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
    79: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
    78: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
    77: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
    76: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
    75: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
    74: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
    73: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
    72: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/commands.rb:18:in `<main>'
    71: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/command.rb:46:in `invoke'
    70: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/command/base.rb:65:in `perform'
    69: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
    68: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
    67: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
    66: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in `perform'
    65: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in `tap'
    64: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:147:in `block in perform'
    63: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:51:in `start'
    62: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:89:in `log_to_stdout'
    61: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/rack-2.0.6/lib/rack/server.rb:354:in `wrapped_app'
    60: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:27:in `app'
    59: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/rack-2.0.6/lib/rack/server.rb:219:in `app'
    58: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/rack-2.0.6/lib/rack/server.rb:319:in `build_app_and_options_from_config'
    57: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/rack-2.0.6/lib/rack/builder.rb:40:in `parse_file'
    56: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/rack-2.0.6/lib/rack/builder.rb:49:in `new_from_string'
    55: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/rack-2.0.6/lib/rack/builder.rb:49:in `eval'
    54: from config.ru:in `<main>'
    53: from config.ru:in `new'
    52: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/rack-2.0.6/lib/rack/builder.rb:55:in `initialize'
    51: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/rack-2.0.6/lib/rack/builder.rb:55:in `instance_eval'
    50: from config.ru:3:in `block in <main>'
    49: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:44:in `require_relative'
    48: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
    47: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
    46: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
    45: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
    44: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
    43: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
    42: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
    41: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
    40: from /Users/haonan/gift/gift_app/config/environment.rb:5:in `<main>'
    39: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/application.rb:361:in `initialize!'
    38: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/initializable.rb:60:in `run_initializers'
    37: from /Users/haonan/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:205:in `tsort_each'
    36: from /Users/haonan/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:226:in `tsort_each'
    35: from /Users/haonan/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:347:in `each_strongly_connected_component'
    34: from /Users/haonan/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:347:in `call'
    33: from /Users/haonan/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:347:in `each'
    32: from /Users/haonan/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:349:in `block in each_strongly_connected_component'
    31: from /Users/haonan/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:431:in `each_strongly_connected_component_from'
    30: from /Users/haonan/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
    29: from /Users/haonan/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:228:in `block in tsort_each'
    28: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/initializable.rb:61:in `block in run_initializers'
    27: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `run'
    26: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `instance_exec'
    25: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/application/finisher.rb:130:in `block in <module:Finisher>'
    24: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/application/routes_reloader.rb:10:in `execute'
    23: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/file_update_checker.rb:83:in `execute'
    22: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/application/routes_reloader.rb:30:in `block in updater'
    21: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/application/routes_reloader.rb:20:in `reload!'
    20: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/application/routes_reloader.rb:41:in `load_paths'
    19: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/application/routes_reloader.rb:41:in `each'
    18: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/railties-5.2.2/lib/rails/application/routes_reloader.rb:41:in `block in load_paths'
    17: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:285:in `load'
    16: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
    15: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:285:in `block in load'
    14: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
    13: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
    12: from /Users/haonan/gift/gift_app/config/routes.rb:1:in `<main>'
    11: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/actionpack-5.2.2/lib/action_dispatch/routing/route_set.rb:414:in `draw'
    10: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/actionpack-5.2.2/lib/action_dispatch/routing/route_set.rb:432:in `eval_block'
     9: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/actionpack-5.2.2/lib/action_dispatch/routing/route_set.rb:432:in `instance_exec'
     8: from /Users/haonan/gift/gift_app/config/routes.rb:7:in `block in <main>'
     7: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/actionpack-5.2.2/lib/action_dispatch/routing/mapper.rb:628:in `mount'
     6: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/actionpack-5.2.2/lib/action_dispatch/routing/mapper.rb:1610:in `match'
     5: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/actionpack-5.2.2/lib/action_dispatch/routing/mapper.rb:1862:in `map_match'
     4: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/actionpack-5.2.2/lib/action_dispatch/routing/mapper.rb:1862:in `each'
     3: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/actionpack-5.2.2/lib/action_dispatch/routing/mapper.rb:1868:in `block in map_match'
     2: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/actionpack-5.2.2/lib/action_dispatch/routing/mapper.rb:1904:in `decomposed_match'
     1: from /Users/haonan/.rvm/gems/ruby-2.5.3/gems/actionpack-5.2.2/lib/action_dispatch/routing/mapper.rb:1933:in `add_route'
/Users/haonan/.rvm/gems/ruby-2.5.3/gems/actionpack-5.2.2/lib/action_dispatch/routing/route_set.rb:584:in `add_route': Invalid route name, already in use: 'ru_captcha'  (ArgumentError)
You may have defined two routes with the same name using the `:as` option, or you may be overriding a route already defined by a resource with the same naming. For the latter, you can restrict the routes created with `resources` as explained here: 
http://guides.rubyonrails.org/routing.html#restricting-the-routes-created

routes.rb 里面去掉 rucaptcha 的那行

3 楼 已删除
需要 登录 后方可回复, 如果你还没有账号请 注册新账号