2016-04-01 7 views
0

Rails 2とRails 4アプリケーション間でセッションを共有しようとしているときに、次の問題が発生しています。未初期化定数ActiveSupport :: HashWithIndifferentAccess Rails 2とRails 4アプリケーション間でセッションを共有中

Status: 500 Internal Server Error 
    uninitialized constant ActiveSupport::HashWithIndifferentAccess 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:469:in `load_missing_constant' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:106:in `rake_original_const_missing' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rake-0.8.3/lib/rake.rb:2465:in `const_missing' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.11/lib/active_support/message_verifier.rb:31:in `load' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.11/lib/active_support/message_verifier.rb:31:in `verify' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/session/cookie_store.rb:171:in `unmarshal' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/session/cookie_store.rb:159:in `unpacked_cookie_data' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/session/abstract_store.rb:257:in `stale_session_check!' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/session/cookie_store.rb:156:in `unpacked_cookie_data' 
    /home/dinesh/tracoffshore/offshore/lib/rails_4_session_flash_backport/rails2/session_with_indifferent_access.rb:43:in `load_session' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/session/abstract_store.rb:132:in `send' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/session/abstract_store.rb:132:in `load!' 
    /home/dinesh/tracoffshore/offshore/lib/rails_4_session_flash_backport/rails2/session_with_indifferent_access.rb:14:in `[]' 
    /home/dinesh/tracoffshore/offshore/vendor/plugins/authlogic-connect/lib/authlogic_connect/callback_filter.rb:14:in `call' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-openid-1.3.1/lib/rack/openid.rb:98:in `call' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/string_coercion.rb:25:in `call' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/head.rb:9:in `call' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/methodoverride.rb:24:in `call' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/params_parser.rb:15:in `call' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/session/cookie_store.rb:99:in `call' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/failsafe.rb:26:in `call' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/lock.rb:11:in `call' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/lock.rb:11:in `synchronize' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/lock.rb:11:in `call' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/dispatcher.rb:114:in `call' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/reloader.rb:34:in `run' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/dispatcher.rb:108:in `call' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rails-2.3.11/lib/rails/rack/static.rb:31:in `call' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/urlmap.rb:47:in `call' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/urlmap.rb:41:in `each' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/urlmap.rb:41:in `call' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rails-2.3.11/lib/rails/rack/log_tailer.rb:17:in `call' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/content_length.rb:13:in `call' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/handler/webrick.rb:48:in `service' 
    /usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' 
    /usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' 
    /usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' 
    /usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:162:in `start' 
    /usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' 
    /usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:95:in `start' 
    /usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:92:in `each' 
    /usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:92:in `start' 
    /usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:23:in `start' 
    /usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:82:in `start' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/handler/webrick.rb:14:in `run' 
    /home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rails-2.3.11/lib/commands/server.rb:111 
    script/server:4:in `require' 
    script/server:4 

私は以下の3つのリンクを参考にしています。

https://www.theguild.nl/share-sessions-between-rails-2-and-rails-3-applications

https://medium.com/ruby-on-rails/3-steps-to-share-a-session-between-rails-3-and-rails-4-applications-9618766e6c2a#.1q15dg9a4。私のレールに2アプリをactivesupportの:: HashWithIndifferentAccessクラスを追加することは依然として

http://webuild.envato.com/blog/upgrading-ruby-on-rails-at-production-scale/

ことができません。

答えて

0

私は、上記のような頭痛の種につながる可能性が高いので、このアプローチをとることを強くお勧めします。

ActiveSupport::HashWithIndifferentAccessは、3より前のRailsバージョンでは使用できません.HashWithIndifferentAccessをRails 2に入れ替える可能性はありますが、正に、レガシーシステムをアップグレードする方がずっと価値があると思います。

エラーを発生させたコードがないと、多くの洞察を与えるのはむしろ困難です。

関連する問題