Ruby on rails 3 rails 4:在routes.rb文件中设计gem路径配置

Ruby on rails 3 rails 4:在routes.rb文件中设计gem路径配置,ruby-on-rails-3,authentication,ruby-on-rails-4,devise,Ruby On Rails 3,Authentication,Ruby On Rails 4,Devise,我正在尝试将我的rails 3应用程序迁移到rails 4版本。Desive gem的routes.rb文件中的以下代码在rails 3版本中正常工作,但相同的代码不适用于rails 4版本 devise_for :users, :controllers => { :passwords => 'passwords'} # devise_for :users, :controllers => { :invitations => 'invitations' }

我正在尝试将我的rails 3应用程序迁移到rails 4版本。Desive gem的routes.rb文件中的以下代码在rails 3版本中正常工作,但相同的代码不适用于rails 4版本

  devise_for :users, :controllers => { :passwords => 'passwords'}

  # devise_for :users, :controllers => { :invitations => 'invitations' }
  devise_for :users
  devise_for :users, :path => '', :path_names => {:sign_in => 'login', :sign_out => 'logout'}

  devise_for :users do
        get "/users/sign_out" => "devise/sessions#destroy", :as => :destroy_user_session
  end  
在Rails4版本中,对于上述代码,我的错误率低于错误率

C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action
_dispatch/routing/route_set.rb:409:in `add_route': Invalid route name, already i
n use: 'new_user_session'  (ArgumentError)
You may have defined two routes with the same name using the `:as` option, or yo
u may be overriding a route already defined by a resource with the same naming.
For the latter, you can restrict the routes created with `resources` as explaine
d here:
http://guides.rubyonrails.org/routing.html#restricting-the-routes-created