RoR:设计 500 错误
当我转到 /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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这看起来很可疑:
自从创建用户模型以来,您是否运行过 db:migrate ?
另外,
建议您没有配置根路径。这是在routes.rb 中匹配对www.yourdomain.com/ 的请求的内容。您可以使用类似的方法
将任何对 www.yourdomain.com/ 的请求定向到页面控制器的主页操作。
This looks suspicious:
Have you run
db:migrate
since creating your User model?Also,
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
which would direct any request to www.yourdomain.com/ to the home action of the pages controller.