看起来我们写的代码中没有提出错误,而是从设计宝石。我猜,我的开发机器配置不正确。
以下是我尝试修复错误的一些事情:
- 我运行 rake db:migrate 和 rake db:terraform 。
- 我运行 bundle install 。
- 我跑了$ c> rvm gemset empty 和 bundle install 重新安装我所有的宝石。
这些都没有起作用。
此外,这是一个更奇怪的事情关于这个错误:
- 我的工作场所的其他开发人员都不会有相同的错误,即使他们在同一个代码库。
- 之后试图弄清楚一段时间的错误,我转到一个分支,我没有更新,因为我开始得到这个错误。即使在周末之前工作,该分支现在也失败了同样的错误。
有人知道我可以做什么修复这个错误?这听起来像我的本地配置的一部分设置不正确吗?
解决方案在我的项目中,我添加了一个文件 app / controllers 调用 devise_controller.rb 。它看起来像这样:
class DeviseController< ApplicationController #要求Devise剩余多少时间,直到当前用户#自动注销,而不需要重置注销计时器。 def time_until_logout raise让我们在这里检查 end end当我删除此文件时,错误消失了。
我提交了关于如何添加 DeviseController 导致RoR / Devise炸毁Devise的存储库: github/ plataformatec / devise / issues / 2520
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?
解决方案In my project, I had added a file in app/controllers called devise_controller.rb. It looked like this:
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 endWhen I deleted this file, the bug went away.
I filed a bug report about how adding a DeviseController caused RoR/Devise to blow up on Devise's repository: github/plataformatec/devise/issues/2520
更多推荐
错误消息:#Error中的NameError / users / sign
发布评论