gpt4 book ai didi

ruby-on-rails - 匿名设计问题 : "[17] is not a symbol"

转载 作者:行者123 更新时间:2023-12-04 05:39:11 24 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





Devise Issue : TypeError - [17] is not a symbol

(3 个回答)


7年前关闭。




设计抛出一个我不明白的问题。

使用更好的错误 gem;这是它被捕获的地方:

在 constantize(gem) activesupport-3.2.12/lib/active_support/inflector/methods.rb 中阻止

  225         names = camel_cased_word.split('::')
226 names.shift if names.empty? || names.first.empty?
227
228 constant = Object
229 names.each do |name|
230 constant = constant.const_defined?(name, false) ?
constant.const_get(name) : constant.const_missing(name)
231 end
232 constant
233 end
234 end

更多细节:
Request info:
Request parameters {"controller"=>"devise/sessions", "action"=>"new"}
Rack session {"session_id"=>"a2bcc708204fb5dce015439f6881f67d","_csrf_token"=>"TzIKUgPy8y4F6kFfkDG/xfgCm4vMqkgReLHbK+cjeFI=", "warden.user.user.key"=>[[17], "$2a$10$/WvxkLxIdgHOMxg8nus6cu"]}


Local Variables:
name [17]
camel_cased_word [17]
names [[17]]
constant Object

有任何想法吗?哪些进一步的信息会有用?

这是跟踪末尾的一大块:
block in ActiveSupport::Inflector.constantize
(gem) activesupport-3.2.12/lib/active_support/inflector/methods.rb, line 230
ActiveSupport::Inflector.constantize
(gem) activesupport-3.2.12/lib/active_support/inflector/methods.rb, line 229
Warden::SessionSerializer#deserialize
(gem) devise-2.2.3/lib/devise/rails/warden_compat.rb, line 27
Warden::SessionSerializer#fetch
(gem) warden-1.2.1/lib/warden/session_serializer.rb, line 35
Warden::Proxy#user
(gem) warden-1.2.1/lib/warden/proxy.rb, line 212
Warden::Proxy#_perform_authentication
(gem) warden-1.2.1/lib/warden/proxy.rb, line 318
Warden::Proxy#authenticate
(gem) warden-1.2.1/lib/warden/proxy.rb, line 104
Warden::Proxy#authenticate?
(gem) warden-1.2.1/lib/warden/proxy.rb, line 114
Devise::SessionsController#require_no_authentication
(gem) devise-2.2.3/app/controllers/devise_controller.rb, line 124
Devise::SessionsController#
_run__642094268016367352__process_action__582726832569976772__callbacks
(gem) activesupport-3.2.12/lib/active_support/callbacks.rb, line 418
Devise::SessionsController.__run_callback
(gem) activesupport-3.2.12/lib/active_support/callbacks.rb, line 405
Devise::SessionsController#_run_process_action_callbacks
(gem) activesupport-3.2.12/lib/active_support/callbacks.rb, line 385
Devise::SessionsController#run_callbacks
(gem) activesupport-3.2.12/lib/active_support/callbacks.rb, line 81
Devise::SessionsController#process_action
(gem) actionpack-3.2.12/lib/abstract_controller/callbacks.rb, line 17
Devise::SessionsController#process_action
(gem) actionpack-3.2.12/lib/action_controller/metal/rescue.rb, line 29
block in Devise::SessionsController#process_action
(gem) actionpack-3.2.12/lib/action_controller/metal/instrumentation.rb, line 30
block in ActiveSupport::Notifications.instrument
(gem) activesupport-3.2.12/lib/active_support/notifications.rb, line 123
ActiveSupport::Notifications::Instrumenter#instrument
(gem) activesupport-3.2.12/lib/active_support/notifications/instrumenter.rb, line 20
ActiveSupport::Notifications.instrument
(gem) activesupport-3.2.12/lib/active_support/notifications.rb, line 123
Devise::SessionsController#process_action
(gem) actionpack-3.2.12/lib/action_controller/metal/instrumentation.rb, line 29
Devise::SessionsController#process_action

最佳答案

我从 2.0.4 更新到 2.2.4,当我使用旧版本更改为我的项目的稳定分支时发生了这种情况。解决方案是清除浏览器中本地主机的所有 cookie。在您的情况下,将是您运行应用程序的服务器。

关于ruby-on-rails - 匿名设计问题 : "[17] is not a symbol",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15870094/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com