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

undefined method `routes' for #<Hash:0x007fd023518b50> #24

Closed
mattiassvedhem opened this issue Aug 8, 2012 · 9 comments
Closed

undefined method `routes' for #<Hash:0x007fd023518b50> #24

mattiassvedhem opened this issue Aug 8, 2012 · 9 comments
Labels

Comments

@mattiassvedhem
Copy link

When mounted in a rails isolated engine I get this error.

Stack

api_taster (0.5.0) lib/api_taster/route.rb:43:in `block in normalise_routes!'
journey (1.0.4) lib/journey/routes.rb:28:in `each'
journey (1.0.4) lib/journey/routes.rb:28:in `each'
api_taster (0.5.0) lib/api_taster/route.rb:37:in `normalise_routes!'
api_taster (0.5.0) lib/api_taster/route.rb:20:in `map_routes'
api_taster (0.5.0) app/controllers/api_taster/routes_controller.rb:28:in `map_routes'
activesupport (3.2.2) lib/active_support/callbacks.rb:429:in `_run__4001414811447523732__process_action__3753406942727699495__callbacks'
activesupport (3.2.2) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.2) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
activesupport (3.2.2) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.2) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.2.2) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (3.2.2) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.2.2) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.2) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.2) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.2.2) lib/action_controller/metal/params_wrapper.rb:205:in `process_action'
activerecord (3.2.2) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (3.2.2) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.2.2) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.2.2) lib/action_controller/metal.rb:203:in `dispatch'
actionpack (3.2.2) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.2) lib/action_controller/metal.rb:246:in `block in action'
actionpack (3.2.2) lib/action_dispatch/routing/route_set.rb:67:in `call'
actionpack (3.2.2) lib/action_dispatch/routing/route_set.rb:67:in `dispatch'
actionpack (3.2.2) lib/action_dispatch/routing/route_set.rb:30:in `call'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.2) lib/action_dispatch/routing/route_set.rb:594:in `call'
railties (3.2.2) lib/rails/engine.rb:479:in `call'
railties (3.2.2) lib/rails/railtie/configurable.rb:30:in `method_missing'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.2) lib/action_dispatch/routing/route_set.rb:594:in `call'
railties (3.2.2) lib/rails/engine.rb:479:in `call'
railties (3.2.2) lib/rails/railtie/configurable.rb:30:in `method_missing'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.2) lib/action_dispatch/routing/route_set.rb:594:in `call'
@fredwu
Copy link
Owner

fredwu commented Aug 12, 2012

Hi, by 'isolated engine', do you mean the mountable engine that has its own namespace? If so, it works on my end, so could you please maybe email me a copy of your engine that has this issue? ifredwu [AT] gmail

Thanks!

@mattiassvedhem
Copy link
Author

Hi, yep. I'll try some further debugging and see if I can find the issue. It's an engine for our company app so I'd rather not mail it but I'll see if I can reproduce it. Thanks!

@chucai
Copy link

chucai commented Sep 9, 2012

I got the same error.

undefined method `routes' for #<Hash:0xa12dfe0>

code:

api_taster (0.5.0) lib/api_taster/route.rb:43:in `block in normalise_routes!'

@chucai
Copy link

chucai commented Sep 9, 2012

I got the reason. Because I mount resque .

@occamsRZR
Copy link

I'm getting the same error. I have been able to run both sidekiq and api_tester at the same time but am unable to replicate. Now the two seem mutually exclusive :(.

@alecnmk
Copy link

alecnmk commented Nov 19, 2012

same here w/ sidekiq mounted.. before or after api_taster.. doesn't matter

@ivobenedito
Copy link
Contributor

Yep, also happening here.
Looks like this is a bug in the discover_rack_app method on the route.rb.
If we have more than 1 rack app mounted in our application routes, this issue will occur.

@ivobenedito
Copy link
Contributor

Submitted a patch which solves this #36

@fredwu Feel free to see if that's ok since I dunno the logic that well.

@fredwu
Copy link
Owner

fredwu commented Dec 12, 2012

Thanks @ivobenedito , merged!

@fredwu fredwu closed this as completed Dec 12, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants