0

I'm working on a RoR app with Devise. When I came in to work today and tried to start up my local dev environment, RoR failed when I tried to go to the sign in page:

NameError at /users/sign_in
undefined local variable or method `require_no_authentication' for #<SessionsController:0x########>

It looks like the error is not being raised within the code we wrote, but instead from deep within the Devise gem. I'm guessing that somehow, my dev machine isn't configured right.

Here are some things I've tried to fix the bug:

  • I ran rake db:migrate and rake db:terraform.
  • I ran bundle install.
  • I ran rvm gemset empty and bundle install to reinstall all of my gems.

None of these worked.

In addition, here are a couple more strange things about this error:

  • None of the other devs at my workplace are having the same error, even though they're on the same codebase.
  • After trying to figure out the error for a while, I switched to a branch that I haven't updated since before I started getting this bug. Even though it was working before the weekend, that branch now fails with the same error.

Does anybody know anything I could do to try to fix this error? Does it sound like some part of my local configuration is incorrectly set up?

4

1 回答 1

0

在我的项目中,我添加了一个app/controllers名为devise_controller.rb. 它看起来像这样:

class DeviseController < ApplicationController
  # Asks Devise how much time is left until the current user is
  # automatically logged out, without resetting the logout timer.
  def time_until_logout
    raise "let's inspect here"
  end
end

当我删除这个文件时,这个错误就消失了。

我提交了一份关于如何添加DeviseController导致 RoR/Devise 在 Devise 的存储库中爆炸的错误报告:https ://github.com/plataformatec/devise/issues/2520

于 2013-07-22T20:01:46.800 回答