尝试使用Authlogic实现重置密码时出现异常

时间:2010-03-13 18:43:50

标签: ruby-on-rails authlogic ruby-1.9

我正在使用Ruby on Rails 2.3.5和Ruby 1.9,并将Authlogic作为我的身份验证引擎。 Authlogic工作正常。但是现在我一直在尝试使用以下教程实现密码重置:
http://www.binarylogic.com/2008/11/16/tutorial-reset-passwords-with-authlogic/

但是当我输入mysite.com/password_resets/new

时,我收到以下异常
Processing PasswordResetsController#new (for 127.0.0.1 at 2010-03-13 01:09:45) [GET]
Completed in 9ms (DB: 0) | 200 [http://localhost/password_resets/new]
[2010-03-13 01:09:45] ERROR TypeError: can't convert Array into String
    /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/activesupport-2.3.5/lib/active_support/core_ext/string/output_safety.rb:34:in `concat'
    /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/activesupport-2.3.5/lib/active_support/core_ext/string/output_safety.rb:34:in `concat_with_safety'
    /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.0.1/lib/rack/handler/webrick.rb:63:in `block in service'
    /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/response.rb:158:in `each'
    /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/response.rb:158:in `each'
    /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:16:in `send'
    /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:16:in `method_missing'
    /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:22:in `method_missing'
    /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.0.1/lib/rack/handler/webrick.rb:62:in `service'
    /Users/tammam56/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
    /Users/tammam56/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
    /Users/tammam56/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'

老实说,我不知道从哪里开始调试。是因为我使用的是Ruby 1.9吗?有些人似乎在使用Authlogic和Ruby 1.9时遇到了麻烦:
http://isitruby19.com/authlogic

请告诉我如何解决/调试这个问题?

谢谢,

1 个答案:

答案 0 :(得分:1)

您可以先为PasswordResetsController#new action运行测试,然后在此处发布输出。