ActionController :: RoutingError (uninitialized regular user :: UsersController) in heroku (but everything works in local mode)

I try to run my application in heroku, but I get this error when trying to register or even access the login page:

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

Is this a design error or server setup that I missed in heroku?

I run the rails3.1 application on the cedar stack and load the index page, but if I try to login or register, it will hit.

The registration form PROVES, but when I submit that when it hits. I checked the logs and it did POST to the controller, but GETting the resulting page (when I redirect, I think) blew 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 

The assistant to the hero also asked about my routes, but why does this only happen in production? Also, I donโ€™t think there are problems with the routes ... is there?

+3
source share
2 answers

It's your problem:

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

Can you remove it?

+1
source

I found that you do not need to remove the default root when the user logs in. Therefore, replace the namespace call and use the following:

 match 'users' => 'users#welcome', :as => 'user_root' 

So you still have two home pages. It worked for me.

https://github.com/plataformatec/devise/wiki/How-To%3a-Redirect-to-a-specific-page-on-successful-sign-in

+6
source

All Articles