Invalid route name, already in use: 'admin_root' (ArgumentError) - Failed ActiveAdmin install

前端 未结 2 548
广开言路
广开言路 2021-01-28 16:20

I ran:

rails g active_admin:install

and got this error:

Invalid route name, already in use: \'admin_root\'  (ArgumentError)
You         


        
2条回答
  •  孤独总比滥情好
    2021-01-28 16:45

    So I found someone having the same problem in this issue-- but that says the problem is that ActiveAdmin puts ActiveAdmin.routes(self) in your config/routes.rb file twice.

    However, your routes doesn't have that line at all-- which I'm guessing is because you ran rails destroy active_admin:install, but that doesn't explain why you're STILL getting that error after destroying.

    Are you using git? Can you see if there were any other modifications made by the generate that might not have been cleaned up by the destroy? The ActiveAdmin issue also hints that if an error happens during generation, the generation doesn't finish correctly.

    Another thing to try would be run the generator again, then check your routes and make sure ActiveAdmin.routes(self) only appears once.

提交回复
热议问题