Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rails 4 disallows multiple routes with the same name, i.e. root #20

Open
mlt opened this issue Feb 22, 2015 · 0 comments
Open

rails 4 disallows multiple routes with the same name, i.e. root #20

mlt opened this issue Feb 22, 2015 · 0 comments

Comments

@mlt
Copy link

mlt commented Feb 22, 2015

Upon cloning (the method on the main page fails), I get the following when attempting to start the server

[mlt@vm myapp (master)]$ rbenv exec rails server
/home/mlt/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.0.0/lib/active_support/values/time_zone.rb:282: warning: circular argument reference - now
=> Booting Thin
=> Rails 4.0.0 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/home/mlt/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:409:in `add_route': Invalid route name, already in use: 'root'  (ArgumentError)
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
        from /home/mlt/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:1440:in `add_route'
        from /home/mlt/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:1417:in `decomposed_match'
...

The following workaround did the trick http://stackoverflow.com/a/24267415/673826 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant