Anonymous problem: "[17] is not a symbol"

The developer throws a problem that I do not understand.

Using the best gem bugs; here where he gets:

block in 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 

Additional Information:

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

Any ideas? What additional information would be helpful?

Here is a fragment from the end of the track:

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
+5
source share
2 answers

I upgraded from 2.0.4 to 2.2.4, and this happened to me when I switched to the stable branch of my project with the old version. The solution was to clear all cookies in the browser for my localhost. In your case, it will be the server on which your application is running.

+3
source

-, , . , , , . : 2.2.4 , . . 2.2.4 https://github.com/plataformatec/devise/blob/master/CHANGELOG.md

, devise >= 2.2.4, devise <= 2.2.3.

. , . <= 2.2.3

session["warden.user.player.key']=["Player", [player_id], "somehashhere"]

>= 2.2.4

session["warden.user.player.key']=[[player_id], "somehashhere"]

, "Player", , . , , .

, . 2.2.4, , 2.2.3, , . -, - (< 2.2.3) "" : . "" , " ".

, db . https://gist.github.com/moll/6417606

cookie ( rails ), , dev

before_filter :fix_session
def fix_session
    key = session["warden.user.player.key"]
    if key && key.is_a?(Array) && key[0].is_a?(Array)
      session["warden.user.player.key"].unshift('Player')
    end
end

? , , , . , .

0

All Articles