gpt4 book ai didi

ruby-on-rails - 将 ruby​​ 从 1.8.7 升级到 1.9.2 后的本地服务器错误(使用 Rails 3.1.1)

转载 作者:太空宇宙 更新时间:2023-11-03 18:27:30 24 4
gpt4 key购买 nike

我刚刚安装了 rvm 并使用 rvm 将 ruby​​ 从 1.8.7 升级到 1.9.2。我在我的应用程序上运行了 bundle install,它重新安装了我的 gems。当我在本地运行 Rails 服务器并将浏览器导航到 localhost:3000 时,服务器日志中显示以下错误:

Started GET "/" for 127.0.0.1 at 2012-01-25 20:10:12 -0800

TypeError (class Date needs to have method `_load'):


Rendered /Users/nicks/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.1ms)
Rendered /Users/nicks/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.9ms)
Rendered /Users/nicks/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (4.2ms)

我是个 Rails 菜鸟,所以请原谅我的无知。非常感谢任何帮助。

这是完整的轨迹:

activesupport (3.1.1) lib/active_support/message_verifier.rb:34:in `load'
activesupport (3.1.1) lib/active_support/message_verifier.rb:34:in `verify'
actionpack (3.1.1) lib/action_dispatch/middleware/cookies.rb:280:in `[]'
actionpack (3.1.1) lib/action_dispatch/middleware/session/cookie_store.rb:53:in `block in unpacked_cookie_data'
actionpack (3.1.1) lib/action_dispatch/middleware/session/abstract_store.rb:55:in `stale_session_check!'
actionpack (3.1.1) lib/action_dispatch/middleware/session/cookie_store.rb:51:in `unpacked_cookie_data'
rack (1.3.5) lib/rack/session/cookie.rb:96:in `extract_session_id'
actionpack (3.1.1) lib/action_dispatch/middleware/session/abstract_store.rb:51:in `block in extract_session_id'
actionpack (3.1.1) lib/action_dispatch/middleware/session/abstract_store.rb:55:in `stale_session_check!'
actionpack (3.1.1) lib/action_dispatch/middleware/session/abstract_store.rb:51:in `extract_session_id'
rack (1.3.5) lib/rack/session/abstract/id.rb:43:in `load_session_id!'
rack (1.3.5) lib/rack/session/abstract/id.rb:32:in `[]'
rack (1.3.5) lib/rack/session/abstract/id.rb:252:in `current_session_id'
rack (1.3.5) lib/rack/session/abstract/id.rb:258:in `session_exists?'
rack (1.3.5) lib/rack/session/abstract/id.rb:104:in `exists?'
rack (1.3.5) lib/rack/session/abstract/id.rb:114:in `load_for_read!'
rack (1.3.5) lib/rack/session/abstract/id.rb:64:in `has_key?'
actionpack (3.1.1) lib/action_dispatch/middleware/flash.rb:260:in `ensure in call'
actionpack (3.1.1) lib/action_dispatch/middleware/flash.rb:261:in `call'
rack (1.3.5) lib/rack/session/abstract/id.rb:195:in `context'
rack (1.3.5) lib/rack/session/abstract/id.rb:190:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/cookies.rb:331:in `call'
activerecord (3.1.1) lib/active_record/query_cache.rb:62:in `call'
activerecord (3.1.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (3.1.1) lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
activesupport (3.1.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.1) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
rails-dev-tweaks (0.5.2) lib/rails_dev_tweaks/granular_autoload/middleware.rb:34:in `call'
rack (1.3.5) lib/rack/sendfile.rb:101:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.1.1) lib/rails/rack/logger.rb:13:in `call'
rack (1.3.5) lib/rack/methodoverride.rb:24:in `call'
rack (1.3.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.1.1) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.3.5) lib/rack/lock.rb:15:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/static.rb:53:in `call'
airbrake (3.0.9) lib/airbrake/user_informer.rb:12:in `call'
railties (3.1.1) lib/rails/engine.rb:456:in `call'
railties (3.1.1) lib/rails/rack/content_length.rb:16:in `call'
railties (3.1.1) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.3.5) lib/rack/handler/webrick.rb:59:in `service'
/Users/nicks/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/Users/nicks/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/Users/nicks/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'

最佳答案

清除您的 cookie:您的应用正在 cookie 中存储 session (这是一个编码的 ruby​​ 对象)。如果我没记错的话,他的编码格式在 1.8 和 1.9 之间发生了变化,因此您的应用程序无法再加载旧 session

关于ruby-on-rails - 将 ruby​​ 从 1.8.7 升级到 1.9.2 后的本地服务器错误(使用 Rails 3.1.1),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9013921/

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