本文介绍了ActionController :: RoutingError(uninitialized constant User :: UsersController)在heroku(但一切都在本地工作)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我试图运行我的应用程序在heroku,但是当尝试注册或甚至访问设计的登录页面时,我收到此错误:

  ActionController :: RoutingError(未初始化的常量User :: UsersController)

这是一个设计错误还是服务器设置我错过了heroku?



我正在运行一个rails3.1应用程序在雪松堆栈的方式和加载索引页是好的,但如果我尝试登录或注册,它会吹动。



注册表单显示,但是当我提交时,这是当它吹。我检查了日志,并且它发送到控制器,但是获取页面(当我被重定向时)会打击它。



任何帮助?



编辑



这是我的路线:

  root:to => home#index

devise_for:users

命名空间:user do
root:to => users#welcome
end

资源:users,:only => :显示

英雄支持人员也问我的路线,但为什么只在生产中发生?另外我不认为路线有什么问题吗?是吗?

解决方案

这是你的问题: p>

 命名空间:user do 
root:to => user#welcome
end

你可以删除吗?


I am trying to run my app in heroku but I get this error when trying to signup or even access devise's login page:

ActionController::RoutingError (uninitialized constant User::UsersController)

Is this a devise bug or a server setting i missed in heroku?

I am running a rails3.1 app in a cedar stack by the way and loading the index page is good, but if I try to login or sign up, it blows.

The signup form DOES show, but when I submit, that's when it blows. I checked the logs and it did POST to the controller but GETting the resulting page(when redirected I guess) blows it up.

Any help?

EDIT

here are my routes:

root :to => "home#index"

devise_for :users

namespace :user do
  root :to => "users#welcome"
end

resources :users, :only => :show

A heroku support person also asked about my routes but why does it happen in production only? Also I don't think there's any problem with the routes...is there?

解决方案

This is your problem:

namespace :user do
  root :to => "users#welcome"
end

Can you remove this?

这篇关于ActionController :: RoutingError(uninitialized constant User :: UsersController)在heroku(但一切都在本地工作)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 16:42