RoR:设计 500 错误

发布于 2024-11-15 13:10:41 字数 659 浏览 2 评论 0原文

当我转到 /users/sign_in (或任何其他设计页面)时,出现 500 错误。

这就是日志的全部内容:

Started GET "/users/sign_in" for 67.161.236.149 at Mon Jun 13 02:51:47 +0000 2011
  Processing by Devise::SessionsController#new as HTML
Completed 500 Internal Server Error in 10ms

ActiveRecord::StatementInvalid (Could not find table 'users'):




Started GET "/users/sign_out" for 67.161.236.149 at Mon Jun 13 10:40:25 +0000 2011
  Processing by Devise::SessionsController#destroy as HTML
Completed 500 Internal Server Error in 135ms

NameError (undefined local variable or method `root_path' for #<Devise::SessionsController:0x605f360>):

出了什么问题?

I'm getting a 500 error when I go to /users/sign_in (or any other devise page).

This is all the log says:

Started GET "/users/sign_in" for 67.161.236.149 at Mon Jun 13 02:51:47 +0000 2011
  Processing by Devise::SessionsController#new as HTML
Completed 500 Internal Server Error in 10ms

ActiveRecord::StatementInvalid (Could not find table 'users'):




Started GET "/users/sign_out" for 67.161.236.149 at Mon Jun 13 10:40:25 +0000 2011
  Processing by Devise::SessionsController#destroy as HTML
Completed 500 Internal Server Error in 135ms

NameError (undefined local variable or method `root_path' for #<Devise::SessionsController:0x605f360>):

What is going wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧情勿念 2024-11-22 13:10:41

这看起来很可疑:

ActiveRecord::StatementInvalid (Could not find table 'users'):

自从创建用户模型以来,您是否运行过 db:migrate ?

另外,

NameError (undefined local variable or method `root_path' for #<Devise::SessionsController:0x605f360>)

建议您没有配置根路径。这是在routes.rb 中匹配对www.yourdomain.com/ 的请求的内容。您可以使用类似的方法

root :to => "pages#home"

将任何对 www.yourdomain.com/ 的请求定向到页面控制器的主页操作。

This looks suspicious:

ActiveRecord::StatementInvalid (Could not find table 'users'):

Have you run db:migrate since creating your User model?

Also,

NameError (undefined local variable or method `root_path' for #<Devise::SessionsController:0x605f360>)

suggests that you don't have a root path configured. This is something in routes.rb that matches requests to www.yourdomain.com/. You could use something like

root :to => "pages#home"

which would direct any request to www.yourdomain.com/ to the home action of the pages controller.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文