3

我最近跑了一个bundle update,现在我变得很奇怪

Type - [17] is not a symbol错误。

这是完整的错误消息:

Started GET "/" for 127.0.0.1 at 2013-05-14 03:46:35 -0500

TypeError - [17] is not a symbol:
  (gem) activesupport-3.2.13/lib/active_support/inflector/methods.rb:230:in `block in constantize'
  (gem) activesupport-3.2.13/lib/active_support/inflector/methods.rb:229:in `constantize'
  (gem) devise-2.2.3/lib/devise/rails/warden_compat.rb:27:in `deserialize'
  (gem) warden-1.2.1/lib/warden/session_serializer.rb:35:in `fetch'
  (gem) warden-1.2.1/lib/warden/proxy.rb:212:in `user'
  (gem) warden-1.2.1/lib/warden/proxy.rb:318:in `_perform_authentication'
  (gem) warden-1.2.1/lib/warden/proxy.rb:104:in `authenticate'
  (gem) warden-1.2.1/lib/warden/proxy.rb:114:in `authenticate?'
  (gem) devise-2.2.3/lib/devise/rails/routes.rb:286:in `block in authenticated'
  (gem) actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:31:in `block in matches?'
  (gem) actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:28:in `matches?'
  (gem) actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:42:in `call'
  (gem) journey-1.0.4/lib/journey/router.rb:68:in `block in call'
  (gem) journey-1.0.4/lib/journey/router.rb:56:in `call'
  (gem) actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:612:in `call'
  (gem) rack-pjax-0.7.0/lib/rack/pjax.rb:12:in `call'
  (gem) newrelic_rpm-3.6.1.88/lib/new_relic/rack/error_collector.rb:12:in `call'
  (gem) newrelic_rpm-3.6.1.88/lib/new_relic/rack/agent_hooks.rb:18:in `call'
  (gem) newrelic_rpm-3.6.1.88/lib/new_relic/rack/browser_monitoring.rb:16:in `call'
  (gem) bullet-4.6.0/lib/bullet/rack.rb:10:in `call'
  (gem) meta_request-0.2.3/lib/meta_request/middlewares/app_request_handler.rb:11:in `call'
  (gem) rack-contrib-1.1.0/lib/rack/contrib/response_headers.rb:17:in `call'
  (gem) meta_request-0.2.3/lib/meta_request/middlewares/headers.rb:16:in `call'
  (gem) meta_request-0.2.3/lib/meta_request/middlewares/meta_request_handler.rb:13:in `call'
  (gem) warden-1.2.1/lib/warden/manager.rb:35:in `block in call'
  (gem) warden-1.2.1/lib/warden/manager.rb:34:in `call'
  (gem) actionpack-3.2.13/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
  (gem) rack-1.4.5/lib/rack/etag.rb:23:in `call'
  (gem) rack-1.4.5/lib/rack/conditionalget.rb:25:in `call'
  (gem) actionpack-3.2.13/lib/action_dispatch/middleware/head.rb:14:in `call'
  (gem) remotipart-1.0.5/lib/remotipart/middleware.rb:30:in `call'
  (gem) actionpack-3.2.13/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  (gem) actionpack-3.2.13/lib/action_dispatch/middleware/flash.rb:242:in `call'
  (gem) rack-1.4.5/lib/rack/session/abstract/id.rb:210:in `context'
  (gem) rack-1.4.5/lib/rack/session/abstract/id.rb:205:in `call'
  (gem) actionpack-3.2.13/lib/action_dispatch/middleware/cookies.rb:341:in `call'
  (gem) activerecord-3.2.13/lib/active_record/query_cache.rb:64:in `call'
  (gem) activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
  (gem) actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
  (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:405:in `_run__1566733404690363964__call__3169664716453937753__callbacks'
  (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:405:in `__run_callback'
  (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:81:in `run_callbacks'
  (gem) actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  (gem) actionpack-3.2.13/lib/action_dispatch/middleware/reloader.rb:65:in `call'
  (gem) actionpack-3.2.13/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  (gem) better_errors-0.8.0/lib/better_errors/middleware.rb:84:in `protected_app_call'
  (gem) better_errors-0.8.0/lib/better_errors/middleware.rb:79:in `better_errors_call'
  (gem) better_errors-0.8.0/lib/better_errors/middleware.rb:56:in `call'
  (gem) actionpack-3.2.13/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  (gem) actionpack-3.2.13/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  (gem) railties-3.2.13/lib/rails/rack/logger.rb:32:in `call_app'
  (gem) railties-3.2.13/lib/rails/rack/logger.rb:16:in `block in call'
  (gem) activesupport-3.2.13/lib/active_support/tagged_logging.rb:22:in `tagged'
  (gem) railties-3.2.13/lib/rails/rack/logger.rb:16:in `call'
  (gem) quiet_assets-1.0.2/lib/quiet_assets.rb:18:in `call_with_quiet_assets'
  (gem) actionpack-3.2.13/lib/action_dispatch/middleware/request_id.rb:22:in `call'
  (gem) rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
  (gem) rack-1.4.5/lib/rack/runtime.rb:17:in `call'
  (gem) activesupport-3.2.13/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  (gem) rack-1.4.5/lib/rack/lock.rb:15:in `call'
  (gem) actionpack-3.2.13/lib/action_dispatch/middleware/static.rb:63:in `call'
  (gem) railties-3.2.13/lib/rails/engine.rb:479:in `call'
  (gem) railties-3.2.13/lib/rails/application.rb:223:in `call'
  (gem) rack-1.4.5/lib/rack/content_length.rb:14:in `call'
  (gem) railties-3.2.13/lib/rails/rack/log_tailer.rb:17:in `call'
  (gem) thin-1.5.1/lib/thin/connection.rb:81:in `block in pre_process'
  (gem) thin-1.5.1/lib/thin/connection.rb:79:in `pre_process'
  (gem) thin-1.5.1/lib/thin/connection.rb:54:in `process'
  (gem) thin-1.5.1/lib/thin/connection.rb:39:in `receive_data'
  (gem) eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
  (gem) thin-1.5.1/lib/thin/backends/base.rb:63:in `start'
  (gem) thin-1.5.1/lib/thin/server.rb:159:in `start'
  (gem) rack-1.4.5/lib/rack/handler/thin.rb:13:in `run'
  (gem) rack-1.4.5/lib/rack/server.rb:268:in `start'
  (gem) railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
  (gem) railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
  (gem) railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
  script/rails:6:in `<main>'

我完全不知道是什么突然导致了这种情况。

不知道这是否会有所帮助,但这是我的Gemfile.lock

GIT
  remote: git://github.com/ctran/annotate_models.git
  revision: 8bd159c7a484093fde84beaa9e6398f25ddacf09
  specs:
    annotate (2.6.0.beta1)
      activerecord (>= 2.3.0)
      rake (>= 0.8.7)

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (3.2.13)
      actionpack (= 3.2.13)
      mail (~> 2.5.3)
    actionpack (3.2.13)
      activemodel (= 3.2.13)
      activesupport (= 3.2.13)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      journey (~> 1.0.4)
      rack (~> 1.4.5)
      rack-cache (~> 1.2)
      rack-test (~> 0.6.1)
      sprockets (~> 2.2.1)
    active_utils (1.0.5)
      activesupport (>= 2.3.11)
      i18n
    activemerchant (1.32.1)
      active_utils (>= 1.0.2)
      activesupport (>= 2.3.14)
      builder (>= 2.0.0)
      i18n
      json (>= 1.5.1)
      money
      nokogiri
    activemodel (3.2.13)
      activesupport (= 3.2.13)
      builder (~> 3.0.0)
    activerecord (3.2.13)
      activemodel (= 3.2.13)
      activesupport (= 3.2.13)
      arel (~> 3.0.2)
      tzinfo (~> 0.3.29)
    activeresource (3.2.13)
      activemodel (= 3.2.13)
      activesupport (= 3.2.13)
    activesupport (3.2.13)
      i18n (= 0.6.1)
      multi_json (~> 1.0)
    acts-as-taggable-on (2.4.1)
      rails (>= 3, < 5)
    addressable (2.3.4)
    arel (3.0.2)
    autoparse (0.3.3)
      addressable (>= 2.3.1)
      extlib (>= 0.9.15)
      multi_json (>= 1.0.0)
    bcrypt-ruby (3.0.1)
    better_errors (0.8.0)
      coderay (>= 1.0.0)
      erubis (>= 2.6.6)
    binding_of_caller (0.7.1)
      debug_inspector (>= 0.0.1)
    bootstrap-sass (2.3.1.0)
      sass (~> 3.2)
    bootstrap-wysihtml5-rails (0.3.1.19)
      railties (>= 3.0)
    builder (3.0.4)
    bullet (4.6.0)
      uniform_notifier
    cancan (1.6.9)
    carrierwave (0.8.0)
      activemodel (>= 3.2.0)
      activesupport (>= 3.2.0)
    coderay (1.0.9)
    coffee-rails (3.2.2)
      coffee-script (>= 2.2.0)
      railties (~> 3.2.0)
    coffee-script (2.2.0)
      coffee-script-source
      execjs
    coffee-script-source (1.6.2)
    countries (0.9.2)
      currencies (>= 0.4.0)
    currencies (0.4.0)
    daemons (1.1.9)
    database_cleaner (1.0.0.RC1)
    debug_inspector (0.0.2)
    devise (2.2.3)
      bcrypt-ruby (~> 3.0)
      orm_adapter (~> 0.1)
      railties (~> 3.1)
      warden (~> 1.2.1)
    diff-lcs (1.2.4)
    email_spec (1.4.0)
      launchy (~> 2.1)
      mail (~> 2.2)
    erubis (2.7.0)
    eventmachine (1.0.3)
    excon (0.21.0)
    execjs (1.4.0)
      multi_json (~> 1.0)
    extlib (0.9.16)
    faraday (0.8.7)
      multipart-post (~> 1.1)
    fog (1.11.0)
      builder
      excon (~> 0.20)
      formatador (~> 0.2.0)
      google-api-client (~> 0.6.2)
      json (~> 1.7)
      mime-types
      net-scp (~> 1.1)
      net-ssh (>= 2.1.3)
      nokogiri (~> 1.5.0)
      ruby-hmac
    font-awesome-sass-rails (3.0.2.2)
      railties (>= 3.1.1)
      sass-rails (>= 3.1.1)
    formatador (0.2.4)
    friendly_id (4.0.9)
    google-api-client (0.6.3)
      addressable (>= 2.3.2)
      autoparse (>= 0.3.3)
      extlib (>= 0.9.15)
      faraday (~> 0.8.4)
      jwt (>= 0.1.5)
      launchy (>= 2.1.1)
      multi_json (>= 1.0.0)
      signet (>= 0.4.4)
      uuidtools (>= 2.1.0)
    haml (4.0.2)
      tilt
    hike (1.2.2)
    i18n (0.6.1)
    journey (1.0.4)
    jquery-rails (2.2.1)
      railties (>= 3.0, < 5.0)
      thor (>= 0.14, < 2.0)
    jquery-ui-rails (3.0.1)
      jquery-rails
      railties (>= 3.1.0)
    json (1.7.7)
    jwt (0.1.8)
      multi_json (>= 1.5)
    kaminari (0.14.1)
      actionpack (>= 3.0.0)
      activesupport (>= 3.0.0)
    launchy (2.3.0)
      addressable (~> 2.3)
    letter_opener (1.0.0)
      launchy (>= 2.0.4)
    libv8 (3.11.8.17)
    mail (2.5.3)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    meta_request (0.2.3)
      rack-contrib
      railties
    mime-types (1.23)
    mini_magick (3.5.0)
      subexec (~> 0.2.1)
    money (5.1.1)
      i18n (~> 0.6.0)
    multi_json (1.7.2)
    multipart-post (1.2.0)
    nested_form (0.3.2)
    net-scp (1.1.0)
      net-ssh (>= 2.6.5)
    net-ssh (2.6.7)
    newrelic_rpm (3.6.1.88)
    nokogiri (1.5.9)
    orm_adapter (0.4.0)
    pg (0.15.1)
    piggybak (0.6.30)
      activemerchant
      countries
      devise
      rack-ssl-enforcer
      rails (~> 3.2.8)
      rails_admin (~> 0.4.5)
    piggybak_bundle_discounts (0.0.5)
      rails (~> 3.2.8)
    piggybak_stripe (0.0.2)
      stripe (= 1.7.4)
    piggybak_variants (0.0.17)
      rails (~> 3.2.3)
    polyglot (0.3.3)
    quiet_assets (1.0.2)
      railties (>= 3.1, < 5.0)
    rack (1.4.5)
    rack-cache (1.2)
      rack (>= 0.4)
    rack-contrib (1.1.0)
      rack (>= 0.9.1)
    rack-pjax (0.7.0)
      nokogiri (~> 1.5)
      rack (~> 1.3)
    rack-ssl (1.3.3)
      rack
    rack-ssl-enforcer (0.2.5)
    rack-test (0.6.2)
      rack (>= 1.0)
    rails (3.2.13)
      actionmailer (= 3.2.13)
      actionpack (= 3.2.13)
      activerecord (= 3.2.13)
      activeresource (= 3.2.13)
      activesupport (= 3.2.13)
      bundler (~> 1.0)
      railties (= 3.2.13)
    rails_admin (0.4.7)
      bootstrap-sass (~> 2.2)
      builder (~> 3.0)
      coffee-rails (~> 3.1)
      font-awesome-sass-rails (~> 3.0, >= 3.0.0.1)
      haml (~> 4.0)
      jquery-rails (~> 2.1)
      jquery-ui-rails (~> 3.0)
      kaminari (~> 0.14)
      nested_form (~> 0.3)
      rack-pjax (~> 0.6)
      rails (~> 3.1)
      remotipart (~> 1.0)
      safe_yaml (~> 0.6)
      sass-rails (~> 3.1)
    railties (3.2.13)
      actionpack (= 3.2.13)
      activesupport (= 3.2.13)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (>= 0.14.6, < 2.0)
    rake (10.0.4)
    rdoc (3.12.2)
      json (~> 1.4)
    ref (1.0.4)
    remotipart (1.0.5)
    rest-client (1.6.7)
      mime-types (>= 1.16)
    rmagick (2.13.2)
    rolify (3.2.0)
    rspec-core (2.13.1)
    rspec-expectations (2.13.0)
      diff-lcs (>= 1.1.3, < 2.0)
    rspec-mocks (2.13.1)
    rspec-rails (2.13.1)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      railties (>= 3.0)
      rspec-core (~> 2.13.0)
      rspec-expectations (~> 2.13.0)
      rspec-mocks (~> 2.13.0)
    ruby-hmac (0.4.0)
    safe_yaml (0.9.1)
    sass (3.2.8)
    sass-rails (3.2.6)
      railties (~> 3.2.0)
      sass (>= 3.1.10)
      tilt (~> 1.3)
    sendgrid (1.1.0)
      json
      json
    sextant (0.2.3)
      activesupport (>= 3.2)
      rails (>= 3.2)
    signet (0.4.5)
      addressable (>= 2.2.3)
      faraday (~> 0.8.1)
      jwt (>= 0.1.5)
      multi_json (>= 1.0.0)
    simple_form (2.1.0)
      actionpack (~> 3.0)
      activemodel (~> 3.0)
    sprockets (2.2.2)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    stripe (1.7.4)
      multi_json (~> 1.1)
      rest-client (~> 1.4)
    subexec (0.2.3)
    therubyracer (0.11.4)
      libv8 (~> 3.11.8.12)
      ref
    thin (1.5.1)
      daemons (>= 1.0.9)
      eventmachine (>= 0.12.6)
      rack (>= 1.0.0)
    thor (0.18.1)
    tilt (1.4.0)
    treetop (1.4.12)
      polyglot
      polyglot (>= 0.3.1)
    tzinfo (0.3.37)
    uglifier (2.0.1)
      execjs (>= 0.3.0)
      multi_json (~> 1.0, >= 1.0.2)
    uniform_notifier (1.2.0)
    uuidtools (2.1.4)
    warden (1.2.1)
      rack (>= 1.0)

PLATFORMS
  ruby

DEPENDENCIES
  acts-as-taggable-on
  annotate!
  better_errors (>= 0.7.2)
  binding_of_caller (>= 0.7.1)
  bootstrap-sass (>= 2.3.0.0)
  bootstrap-wysihtml5-rails
  bullet
  cancan (>= 1.6.9)
  carrierwave
  coffee-rails (~> 3.2.1)
  database_cleaner (>= 1.0.0.RC1)
  devise (>= 2.2.3)
  email_spec (>= 1.4.0)
  execjs
  fog
  font-awesome-sass-rails
  friendly_id
  jquery-rails
  letter_opener
  meta_request
  mini_magick
  newrelic_rpm
  pg (>= 0.15.0)
  piggybak
  piggybak_bundle_discounts
  piggybak_stripe
  piggybak_variants
  quiet_assets (>= 1.0.2)
  rails (= 3.2.13)
  rails_admin
  rmagick
  rolify (>= 3.2.0)
  rspec-rails (>= 2.12.2)
  sass-rails (~> 3.2.3)
  sendgrid (>= 1.0.1)
  sextant
  simple_form (>= 2.1.0)
  therubyracer
  thin (>= 1.5.0)
  uglifier (>= 1.0.3)

编辑 1

这是我的Gemfile

source 'https://rubygems.org'

gem 'rails', '3.2.13'

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
end

group   :development do
    gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git'
    gem 'sextant'
  gem "quiet_assets", ">= 1.0.2"
  gem "better_errors", ">= 0.7.2"
  gem "binding_of_caller", ">= 0.7.1"    
    gem 'meta_request'
    gem 'execjs'
    gem 'therubyracer'  
  gem "letter_opener"
  gem 'bullet'   
  # gem 'rack-mini-profiler'   
end

group :test do
  gem "database_cleaner", ">= 1.0.0.RC1"
  gem "email_spec", ">= 1.4.0"
end

group :development, :test do
  gem "rspec-rails", ">= 2.12.2"
end

gem 'jquery-rails'
gem "thin", ">= 1.5.0"
gem "pg", ">= 0.15.0"
gem "font-awesome-sass-rails"
gem "bootstrap-sass", ">= 2.3.0.0"
gem "bootstrap-wysihtml5-rails"
gem "bootstrap-sass", ">= 2.3.0.0"
gem "sendgrid", ">= 1.0.1"
gem "devise", ">= 2.2.3"
gem "cancan", ">= 1.6.9"
gem "rolify", ">= 3.2.0"
gem "simple_form", ">= 2.1.0"
gem "newrelic_rpm"
gem "rmagick"
gem "mini_magick"
gem "carrierwave"
gem "fog"
gem "piggybak"
gem "piggybak_variants"
gem "piggybak_bundle_discounts"
gem "rails_admin"
gem "acts-as-taggable-on"
gem "friendly_id"
gem "piggybak_stripe"
4

3 回答 3

7

这里有几点需要注意:

  1. 在 Gemfile 中指定要更新到的最大版本更安全
  2. 您的会话没有正确反序列化 - 这是您看到的异常的原因
  3. 如果您在使用单个 gem 时遇到问题并需要更新,请使用bundle update <gem name>

指定最大 Gem 版本

您应该开始在 Gemfile中使用悲观版本约束(运算符)。~>这实质上允许您说宝石只能更新到更高的补丁级别。

Ruby 开发人员倾向于使用具有三个数字的版本号标准:xxx,例如2.0.1。第一个数字是主要版本,第二个数字是次要版本,第三个数字是补丁。

主要版本更新可能会破坏旧功能。如果您从1.xx升级到2.xx,这可能是一个痛苦的过程。次要版本更新应添加功能,并在极少数情况下更改现有功能,但应向后兼容。补丁级别更新应该是纯粹的错误修复。

悲观版本约束可以用来说“只允许补丁级别更新”。例如:

gem 'devise', '~> 2.2.3'  # Only the '.3' can increase, e.g. 2.2.4, 2.2.5

如果您对所有 gem 执行此操作,那么您可以合理地确定bundle update会将 gem 更新到兼容版本。在您的 Gemfile 中,您有

gem 'devise', '>= 2.2.3'

这可能会允许安装设计3.0.0,您几乎可以保证这是有问题的。

找到一个有效的 gem 配置,然后使用悲观版本约束将您的 Gemfile 锁定为仅补丁级别更新是一个很好的做法。

会话反序列化

看起来设计已更新,这导致了会话反序列化问题。您可以查看您的旧版本Gemfile.lock,然后降级到正在运行的设计版本。或者,如果您在会话中没有任何重要内容,则可以清除缓存并使用新版本。

更新单个 gem

Runningbundle update将尝试更新 Gemfile 中的所有 gem。如果您只需要更新单个 gem,请使用bundle update <gem name>. 所有其他人将保持相同的版本。

于 2013-05-14T10:10:36.447 回答
5

这个问题是很久以前发布的,所以我想原来的人不再需要答案了。但可能有像我这样的人迫切需要一个答案,而不是炸毁所有会话。这是原因和我的解决方案:Devise 2.2.4 具有向后不兼容的更改,会破坏所有现有会话。请参阅 2.2.4 的更改日志 https://github.com/plataformatec/devise/blob/master/CHANGELOG.md

devise >=2.2.4 创建的会话不能被 devise <=2.2.3 正确处理。

问题来自使用的会话密钥设计。假设您已经设计了 Player 模型。对于设计<=2.2.3,会话在会话中具有以下内容

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

对于 devise>=2.2.4,会话变为以下

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

我想设计作者不喜欢“播放器”,因为它已经在许多不同的地方以及密钥本身中指定。这是一个合理的更改,新代码确实可以正确处理升级,因为它可以理解旧会话并保持未完成的会话活动。

但这只能解决升级问题,而不是降级问题。如果您将您的设备升级到 2.2.4,登录然后降级到 2.2.3,您将看到类似这样的错误。显然在设计代码(<2.2.3)的某个地方,它将“播放”转换为符号:用户。但是“用户”不再存在,并且出现“不是符号”错误。

仅当您将数据库存储用于会话时,设计页面才指向解决方案。您需要迁移该 https://gist.github.com/moll/6417606

如果你使用 cookie store 存储(rails 长期默认),那么你从更高版本的设计降级时需要将以下代码添加到应用程序控制器

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

至于为什么降级?如果您确定一切正常并且您永远不必回滚,那么这不是问题。但是,如果您不确定,您将需要这个。

于 2014-02-10T20:23:37.937 回答
2

我将我的 Gemfile 更新为gem "devise", ">= 2.2.4"然后删除我Gemfile.lock的并通过执行重新创建它bundle install

无论出于何种原因,这似乎已经解决了这个特定问题。

我不能肯定地说,虽然它是由那个版本的设计引起的。它可能是另一个已更新的宝石 - 但这是我所做的唯一有效的更改。

所以,带着一粒盐。

于 2013-05-15T22:40:06.493 回答