[英]Devise 404 errors on production server, No route matches {:controller=>“devise/home”}
I'm getting devise 404 errors on a production server, both for get requests to /users/sign_in and its "link_to" equivalent. 我在生产服务器上遇到404错误,都是针对/ users / sign_in的获取请求及其等效的“ link_to”。 If I copy development.rb to production.rb, I get the error: 如果我将development.rb复制到production.rb,则会收到错误消息:
No route matches {:controller=>"devise/home"} 没有路线符合{:controller =>“ devise / home”}
This: 这个:
Works on my development box. 在我的开发箱上工作。
Doesn't work on the production box using either webbrick or passenger. 使用webbrick或passenger在生产盒上不起作用。
All other routes are working OK, but the devise routes are not. 所有其他路线都可以正常工作,但设计路线则不行。 I think I've read every stackoverflow and other google-fu link I can find twice, but no luck so far. 我想我已经阅读了我可以找到两次的每个stackoverflow和其他google-fu链接,但到目前为止还没有运气。
"Rake routes" output is below. 下面是“耙路”的输出。 If I try the route that /users/sign_in GET resolves to, (ie, devise/sessions#new), I get the error: No route matches [GET] "/devise/sessions" 如果我尝试使用/ users / sign_in GET解析的路由(即devise / sessions#new),则会收到错误消息:没有匹配[GET]“ / devise / sessions”的路由
None of the following work: 没有以下工作:
link_to('Login / Register', new_user_session_path) link_to('Login / Regsiter', :controller => "devise/sessions", :action => "new") link_to('Login / Regsiter', :controller => "/devise/sessions", :action => "new") link_to('Login / Register', '/users/sign_up') link_to('登录/注册',new_user_session_path)link_to('登录/注册',:controller =>“设计/会话”,:action =>“新”)link_to('登录/ Regsiter',:controller =>“ / devise / sessions”,:action =>“ new”)link_to('登录/注册','/ users / sign_up')
I've seen some references to scoping issues, but I'll be darned if that makes any sense to me given the symptoms. 我已经看到了一些有关范围界定问题的参考,但是如果给定这些症状对我来说有意义的话,我会感到惊讶。 I'm completely stumped on this one. 我完全被这个困扰。 Any ideas? 有任何想法吗?
Contents of routes.rb and "rake routes" output follow: route.rb和“ rake route”输出的内容如下:
Aprojectx::Application.routes.draw do
devise_for :users
match "/people/test" => "people#test"
resources :people Aprojectx::Application.routes.draw do
devise_for :users
match "/people/test" => "people#test"
resources :people
resources :document_versions
resources :documents
resources :escrow_roles
resources :escrows
resources :tasks
root :to => 'home#index'
match "/specification" => 'home#specification'
match "/sales" => 'home#sales'
end
resources :document_versions
Aprojectx::Application.routes.draw do
devise_for :users
match "/people/test" => "people#test"
resources :people
resources :document_versions Aprojectx::Application.routes.draw do
devise_for :users
match "/people/test" => "people#test"
resources :people
resources :document_versions
resources :documents
resources :escrow_roles
resources :escrows
resources :tasks
root :to => 'home#index'
match "/specification" => 'home#specification'
match "/sales" => 'home#sales'
end
resources :documents
resources :escrow_roles
resources :escrows
resources :tasks
root :to => 'home#index'
match "/specification" => 'home#specification'
match "/sales" => 'home#sales'
end
resources :documents
resources :escrow_roles
resources :escrows
resources :tasks
root :to => 'home#index'
match "/specification" => 'home#specification'
match "/sales" => 'home#sales'
end
root@escrowmaker:/var/www/apps/aprojectx# rake routes
people_test /people/test(.:format) people#test
people GET /people(.:format) people#index
POST /people(.:format) people#create
new_person GET /people/new(.:format) people#new
edit_person GET /people/:id/edit(.:format) people#edit
person GET /people/:id(.:format) people#show
PUT /people/:id(.:format) people#update
DELETE /people/:id(.:format) people#destroy
document_versions GET /document_versions(.:format) document_versions#index
POST /document_versions(.:format) document_versions#create
new_document_version GET /document_versions/new(.:format) document_versions#new
edit_document_version GET /document_versions/:id/edit(.:format) document_versions#edit
document_version GET /document_versions/:id(.:format) document_versions#show
PUT /document_versions/:id(.:format) document_versions#update
DELETE /document_versions/:id(.:format) document_versions#destroy
documents GET /documents(.:format) documents#index
POST /documents(.:format) documents#create
new_document GET /documents/new(.:format) documents#new
edit_document GET /documents/:id/edit(.:format) documents#edit
document GET /documents/:id(.:format) documents#show
PUT /documents/:id(.:format) documents#update
DELETE /documents/:id(.:format) documents#destroy
escrow_roles GET /escrow_roles(.:format) escrow_roles#index
POST /escrow_roles(.:format) escrow_roles#create
new_escrow_role GET /escrow_roles/new(.:format) escrow_roles#new
edit_escrow_role GET /escrow_roles/:id/edit(.:format) escrow_roles#edit
escrow_role GET /escrow_roles/:id(.:format) escrow_roles#show
PUT /escrow_roles/:id(.:format) escrow_roles#update
DELETE /escrow_roles/:id(.:format) escrow_roles#destroy
escrows GET /escrows(.:format) escrows#index
POST /escrows(.:format) escrows#create
new_escrow GET /escrows/new(.:format) escrows#new
edit_escrow GET /escrows/:id/edit(.:format) escrows#edit
escrow GET /escrows/:id(.:format) escrows#show
PUT /escrows/:id(.:format) escrows#update
DELETE /escrows/:id(.:format) escrows#destroy
tasks GET /tasks(.:format) tasks#index
POST /tasks(.:format) tasks#create
new_task GET /tasks/new(.:format) tasks#new
edit_task GET /tasks/:id/edit(.:format) tasks#edit
task GET /tasks/:id(.:format) tasks#show
PUT /tasks/:id(.:format) tasks#update
DELETE /tasks/:id(.:format) tasks#destroy
root / home#index
specification /specification(.:format) home#specification
sales /sales(.:format) home#sales
new_user_session GET /users/sign_in(.:format) devise/sessions#new
user_session POST /users/sign_in(.:format) devise/sessions#create
destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
user_password POST /users/password(.:format) devise/passwords#create
new_user_password GET /users/password/new(.:format) devise/passwords#new
edit_user_password GET /users/password/edit(.:format) devise/passwords#edit
PUT /users/password(.:format) devise/passwords#update
cancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel
user_registration POST /users(.:format) devise/registrations#create
new_user_registration GET /users/sign_up(.:format) devise/registrations#new
edit_user_registration GET /users/edit(.:format) devise/registrations#edit
PUT /users(.:format) devise/registrations#update
DELETE /users(.:format) devise/registrations#destroy
The answer -- turn on config.log_level = :debug in productiono.rb, then work from there. 答案-在productiono.rb中打开config.log_level =:debug,然后从那里开始工作。 Indeed, I had to add a leading forward slash to controller names starting with "home" in some of my layout partials. 确实,我必须在我的某些布局局部中以“ home”开头的控制器名称前加一个斜杠。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.