我在生产服务器上遇到设计404错误,无论是对/ users / sign_in的获取请求还是与“link_to”等价的请求。如果我将development.rb复制到production.rb,我会收到错误:
没有路线匹配{:controller =>“devise / home”}
这:
适用于我的开发框。
使用网络布或乘客在生产箱上不起作用。
所有其他路线都正常,但设计路线不行。我想我已经阅读了每次stackoverflow和其他google-fu链接,我可以找到两次,但到目前为止没有运气。
“Rake routes”输出如下。如果我尝试/ users / sign_in GET解析的路由(即设计/会话#new),我得到错误:没有路由匹配[GET]“/ devise / sessions”
以下工作均无效:
link_to('登录/注册',new_user_session_path) link_to('Login / Regsiter',: controller =>“devise / sessions”,:action =>“new”) link_to('Login / Regsiter',: controller =>“/ devise / sessions”,:action =>“new”) link_to('登录/注册','/ users / sign_up')
我已经看到一些关于范围问题的参考,但如果这对我有任何意义,我将会感到沮丧。我完全被这个困扰了。有什么想法吗?
routes.rb和“rake routes”输出的内容如下:
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
答案 0 :(得分:1)
答案 - 在productiono.rb中启用config.log_level =:debug,然后从那里开始工作。实际上,我必须在我的一些布局部分中以“home”开头的控制器名称添加一个前导斜杠。