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

Cannot use rake with mount_devise_token_auth_for in routes.rb #570

Closed
ghost opened this issue Mar 11, 2016 · 2 comments
Closed

Cannot use rake with mount_devise_token_auth_for in routes.rb #570

ghost opened this issue Mar 11, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Mar 11, 2016

I used rails g devise_token_auth:install User auth so I have mount_devise_token_auth_for in my config/routes.rb.
When I run rake db:migrate or any rake actions I get:

** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment rake aborted! NameError: uninitialized constant ActionDispatch::Routing::Mapper::Scope C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/devise_token_auth-0.1.37/lib/devise_token_auth/rails/routes.rb:40:in 'block in mount_devise_token_auth_for' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/devise_token_auth-0.1.37/lib/devise_token_auth/rails/routes.rb:86:in 'unnest_namespace' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/devise_token_auth-0.1.37/lib/devise_token_auth/rails/routes.rb:32:in 'mount_devise_token_auth_for' C:/Dev/tests/testapp/config/routes.rb:2:in 'block in <top (required)>' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.1.8/lib/action_dispatch/routing/route_set.rb:337:in 'instance_exec' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.1.8/lib/action_dispatch/routing/route_set.rb:337:in 'eval_block' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.1.8/lib/action_dispatch/routing/route_set.rb:315:in 'draw' C:/Dev/tests/testapp/config/routes.rb:1:in '<top (required)>' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/application/routes_reloader.rb:40:in 'block in load_paths' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/application/routes_reloader.rb:40:in 'each' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/application/routes_reloader.rb:40:in 'load_paths' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/application/routes_reloader.rb:16:in 'reload!' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/application/routes_reloader.rb:26:in 'block in updater' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/file_update_checker.rb:75:in 'call' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.1.8/lib/active_support/file_update_checker.rb:75:in 'execute' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/application/routes_reloader.rb:27:in 'updater' C:in 'execute_if_updated' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/application/finisher.rb:71:in 'block in <module:Finisher>' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/initializable.rb:30:in 'instance_exec' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/initializable.rb:30:in 'run' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/initializable.rb:55:in 'block in run_initializers' C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/tsort.rb:226:in 'block in tsort_each' C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/tsort.rb:348:in 'block (2 levels) in each_strongly_connected_component' C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/tsort.rb:427:in 'each_strongly_connected_component_from' C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/tsort.rb:347:in 'block in each_strongly_connected_component' C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/tsort.rb:345:in 'each' C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/tsort.rb:345:in 'call' C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/tsort.rb:345:in 'each_strongly_connected_component' C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/tsort.rb:224:in 'tsort_each' C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/tsort.rb:205:in 'tsort_each' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/initializable.rb:54:in 'run_initializers' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/application.rb:300:in 'initialize!' C:/Dev/tests/testapp/config/environment.rb:5:in '<top (required)>' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/application.rb:276:in 'require_environment!' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.8/lib/rails/application.rb:389:in 'block in run_tasks_blocks' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/lib/rake/task.rb:240:in 'call' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/lib/rake/task.rb:240:in 'block in execute' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/lib/rake/task.rb:235:in 'each' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/lib/rake/task.rb:235:in 'execute' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/lib/rake/task.rb:179:in 'block in invoke_with_call_chain' C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/monitor.rb:211:in 'mon_synchronize' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/lib/rake/task.rb:172:in 'invoke_with_call_chain' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/lib/rake/task.rb:201:in 'block in invoke_prerequisites' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/lib/rake/task.rb:199:in 'each' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/lib/rake/task.rb:199:in 'invoke_prerequisites' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/lib/rake/task.rb:178:in 'block in invoke_with_call_chain' C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/monitor.rb:211:in 'mon_synchronize' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/lib/rake/task.rb:172:in 'invoke_with_call_chain' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/lib/rake/task.rb:165:in 'invoke' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/lib/rake/application.rb:150:in 'invoke_task' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/lib/rake/application.rb:106:in 'block (2 levels) in top_level' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/lib/rake/application.rb:106:in 'each' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/lib/rake/application.rb:106:in 'block in top_level' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/lib/rake/application.rb:115:in 'run_with_threads' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/lib/rake/application.rb:100:in 'top_level' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/lib/rake/application.rb:78:in 'block in run' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/lib/rake/application.rb:176:in 'standard_exception_handling' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/lib/rake/application.rb:75:in 'run' C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.5.0/bin/rake:33:in '<top (required)>' C:/RailsInstaller/Ruby2.1.0/bin/rake:23:in 'load' C:/RailsInstaller/Ruby2.1.0/bin/rake:23:in '<main>' Tasks: TOP => db:migrate => environment

When I remove mount_devise_token_auth_for from config/routes.rb, the migration runs normally.
Can you help me to understand this?

@styledev
Copy link

I can't even start my server when this line is in my routes.rb file inside the namespace scope :v1

@zachfeldman
Copy link
Contributor

Hi there @danielprudhomme ,

In an effort to cleanup this project and prioritize a bit, we're marking issues that haven't had any activity in a while with a "close-in-7-days" label. If we don't hear from you in about a week, we'll be closing this issue. Obviously feel free to re-open it at any time if it's the right time or this was done in error!

If you are still having the issue (especially if it's a bug report) please refer to our new Issue Template to provide some more details to help us solve it.

Hope all is well.

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

No branches or pull requests

2 participants