Rails应用程序不会使用设计删除用户帐户

时间:2012-10-11 09:04:58

标签: ruby-on-rails devise

我正在尝试从RailsApps项目模板创建一个prelaunch注册页面:http://railsapps.github.com/rails-prelaunch-signup/

我已将它部署到Heroku,基本网站运行正常。你可以在这里找到它:http://arcane-lake-2098.herokuapp.com

问题是用户无法使用app / views / devise / registrations / edit.html.erb中的以下代码删除他/她的帐户

<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %>.</p>

其他一切正常(创建帐户,编辑名称,密码等等) - 但是当我点击“取消我的帐户”然后在弹出窗口中单击“确定”时,它会显示“我们很抱歉,但有些事情已经发生了错“。

我正在使用rails 3.2.8

我已经搜遍了所有Q&amp; A,其他大多数人似乎都遇到了路径问题。

以下是错误的日志:

2012-10-11T09:46:49+00:00 app[web.1]: Started POST "/users/sign_in" for 49.2.27.159 at 2012-10-11 09:46:49 +0000
2012-10-11T09:46:49+00:00 heroku[router]: POST arcane-lake-2098.herokuapp.com/users/sign_in dyno=web.1 queue=0 wait=0ms service=118ms status=302 bytes=104
2012-10-11T09:46:49+00:00 app[web.1]: 
2012-10-11T09:46:49+00:00 app[web.1]: Started GET "/" for 49.2.27.159 at 2012-10-11 09:46:49 +0000
2012-10-11T09:46:49+00:00 app[web.1]: 
2012-10-11T09:46:49+00:00 heroku[router]: GET arcane-lake-2098.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=11ms status=200 bytes=1521
2012-10-11T09:46:51+00:00 app[web.1]: 
2012-10-11T09:46:51+00:00 app[web.1]: 
2012-10-11T09:46:51+00:00 app[web.1]: Started GET "/users/edit" for 49.2.27.159 at 2012-10-11 09:46:51 +0000
2012-10-11T09:46:51+00:00 heroku[router]: GET arcane-lake-2098.herokuapp.com/users/edit dyno=web.1 queue=0 wait=0ms service=15ms status=200 bytes=2949
2012-10-11T09:46:56+00:00 app[web.1]: 
2012-10-11T09:46:56+00:00 app[web.1]: 
2012-10-11T09:46:56+00:00 app[web.1]: Started DELETE "/users" for 49.2.27.159 at 2012-10-11 09:46:56 +0000
2012-10-11T09:46:57+00:00 app[web.1]: 
2012-10-11T09:46:57+00:00 app[web.1]: 
2012-10-11T09:46:57+00:00 app[web.1]: 
2012-10-11T09:46:57+00:00 app[web.1]: Hominid::APIError (<232> There is no record of "wheresclark@gmail.com" in the database):
2012-10-11T09:46:57+00:00 app[web.1]:   app/models/user.rb:69:in `remove_user_from_mailchimp'
2012-10-11T09:46:57+00:00 heroku[router]: POST arcane-lake-2098.herokuapp.com/users dyno=web.1 queue=0 wait=0ms service=436ms status=500 bytes=643

随时注册并尝试取消您的帐户以查看我的意思。

1 个答案:

答案 0 :(得分:1)

此错误通常意味着应用程序会抛出500个状态代码。你需要看 at your logs然后搜索精确错误。

更新1

正如app / models / user.rb第69行中的错误所示,尝试通过电子邮件“wheresclark@gmail.com”查找用户。据我所知,它使用HominidAPI访问远程数据库。你可能只是缺少这里的存在检查,不能肯定地说因为它没有代码(它可能是特定于上下文的)。我认为在执行此方法之前删除了用户,这会导致问题。