如何修复或重新安装restful_authentication插件?
我最近将 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 的副本已被删除...”错误。自从从 git 获取最新的 Restful_authentication 以来,另外 2 个错误是新的。
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'
I recently upgraded my rails from 2.0.1 to 2.3.3 and since then have been seeing erratic behavior with the restful_authentication plugin. Below are 3 of the errors and stack traces that I got some of the time, but not all the time. I get these on separate requests, but the code-editing here put them all together.
I got the latest version of the restful-authentication plugin with git, and then deleted the old restful-authentication folder under vender/plugins in my rails app, and copied over that directory from the latest clone from git. This was my first time using git, I didn't know the proper way to install the restful-auth plugin into my app, besides manually copying the directories.
I was getting the 'copy of AuthenticatedSystem has been removed...' error after the upgrade from rails 2.0.1 to 2.3.3, but before getting the latest from git. The other 2 errors are new since getting the latest restful_authentication from git.
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'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来它肯定找不到执行这些方法所需的库。您可以运行 ./script/plugin install -f 来强制重新安装吗?
Definitely looks like it can't find the libraries it needs to execute those methods. Can you just run ./script/plugin install -f to force a reinstall?