Bummer! You must be logged in to access this page.

Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

rake aborted!

I'm getting this error message: ArgumentError: Invalid route name, already in use: 'new_user_session' How would you fix this?

Can you post up your routes.rb file? Also the output when you run rake routes.

1 Answer

Hi Mike, Sure, here's routes.rb:

Rails.application.routes.draw do devise_for :users resources :statuses root to: 'statuses#index' devise_for :users end

When I run rake routes, here's the output:

Michaels-MacBook-Pro:treebook michaelbaker$ rake routes rake aborted! ArgumentError: Invalid route name, already in use: 'new_user_session' You may have defined two routes with the same name using the :as option, or you 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 explained here: http://guides.rubyonrails.org/routing.html#restricting-the-routes-created /Users/michaelbaker/ruby-build/treebook/config/routes.rb:8:in block in <top (required)>' /Users/michaelbaker/ruby-build/treebook/config/routes.rb:1:in<top (required)>' /Users/michaelbaker/ruby-build/treebook/config/environment.rb:5:in `<top (required)>' Tasks: TOP => routes => environment (See full trace by running task with --trace) Michaels-MacBook-Pro:treebook michaelbaker$

Thanks, Michael