Could not find devise mapping for path "/". This may happen for two reasons: 1) You forgot to wrap your route inside the scope block. For example: devise_scope :user do get "/some/route" => "some_devise_controller" end 2) You are testing a Devise controller bypassing the router. If so, you can explicitly tell Devise which mapping to use: @request.env["devise.mapping"] = Devise.mappings[:user]
當我嘗試去這裏Devise_scope - 找不到設計映射路徑「/」
http://localhost:3000/
在這裏,我得到這個錯誤是路線
devise_scope :user do
get '/users/sign_in' => 'devise/sessions#new', as: :new_user_session
post '/users/sign_in' => 'devise/sessions#create', as: :user_session
delete '/users/sign_out' => 'devise/sessions#destroy', as: :destroy_user_session
post '/users/password' => 'devise/passwords#create', as: :user_password
put '/users/password' => 'devise/passwords#update', as: nil
patch '/users/password' => 'devise/passwords#update', as: nil
authenticated :user do
root :to => 'home#index', as: :authenticated_root
end
unauthenticated :user do
root :to => 'devise/sessions#new', as: :unauthenticated_root
end
end
這組我們不知道爲什麼它突然失敗了。關於我的設置(從內存)詳細信息:我做
bundle install
與捏造,寶石
rails g devise user
rails generate devise:views
我加入development.rb
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
而且這條線,我使用導軌4.2.0.beta1和devise 3.3.0從(git =>'https://github.com/plataformatec/devise.git',:branch =>'lm-rails-4-2')拉動