1

我最近将我的 rails 从 2.0.1 升级到了 2.3.3,从那时起,我发现 restful_authentication 插件出现了不稳定的行为。以下是我在某些时候得到的 3 个错误和堆栈跟踪,但并非一直如此。我在单独的请求中得到这些,但这里的代码编辑将它们放在一起。

我使用 git 获得了最新版本的 restful-authentication 插件,然后在我的 rails 应用程序中删除了 vender/plugins 下旧的 restful-authentication 文件夹,并从 git 的最新克隆中复制了该目录。这是我第一次使用 git,除了手动复制目录之外,我不知道将 restful-auth 插件安装到我的应用程序中的正确方法。

从 rails 2.0.1 升级到 2.3.3 之后,但在从 git 获取最新版本之前,我收到了“已删除 AuthenticatedSystem 的副本...”错误。其他 2 个错误是从 git 获取最新的 restful_authentication 后的新错误。

ArgumentError (A copy of AuthenticatedSystem has been removed from the module tree but is still active!):
  lib/authenticated_system.rb:97:in `login_from_session'
  lib/authenticated_system.rb:12:in `current_user'
  lib/authenticated_system.rb:6:in `logged_in?'
  lib/authenticated_system.rb:34:in `authorized?'
  lib/authenticated_system.rb:52:in `login_required'
  C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
  C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'


TypeError (can't dup NilClass):
  lib/authenticated_system.rb:97:in `login_from_session'
  lib/authenticated_system.rb:12:in `current_user'
  lib/authenticated_system.rb:6:in `logged_in?'
  lib/authenticated_system.rb:34:in `authorized?'
  lib/authenticated_system.rb:52:in `login_required'
  C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
  C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
  C:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'


SystemStackError (stack level too deep):
  lib/authenticated_system.rb:17:in `current_user='
  lib/authenticated_system.rb:97:in `login_from_session'
  lib/authenticated_system.rb:12:in `current_user'
  lib/authenticated_system.rb:6:in `logged_in?'
  lib/authenticated_system.rb:34:in `authorized?'
  lib/authenticated_system.rb:52:in `login_required'
  C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
  C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
  C:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
4

1 回答 1

0

绝对看起来它找不到执行这些方法所需的库。你可以运行 ./script/plugin install -f 来强制重新安装吗?

于 2009-12-09T16:25:24.170 回答