austvik / wadlgen

Create WADL descriptors based on rails routes
MIT License
16 stars 6 forks source link

rails 31 error? #2

Open saranyan opened 12 years ago

saranyan commented 12 years ago

Hey, I was trying this gem out. Is the error 31 specific? Thanks. :)

bundle exec rake wadlgen rake aborted! wrong constant name _controller

Tasks: TOP => wadlgen (See full trace by running task with --trace)

saranyan commented 12 years ago

The full trace, if that is helpful.

Tasks: TOP => wadlgen (See full trace by running task with --trace) LM-AUN-00712319:milo_test svigraham$ bundle exec rake wadlgen --trace * Invoke wadlgen (first_time) * Invoke environment (first_time) * Execute environment * Execute wadlgen rake aborted! wrong constant name _controller /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/bundler/gems/wadlgen-b4e7f9a10454/lib/wadlgen/route_parser.rb:59:in const_get' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/bundler/gems/wadlgen-b4e7f9a10454/lib/wadlgen/route_parser.rb:59:inget_representations' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/bundler/gems/wadlgen-b4e7f9a10454/lib/wadlgen/route_parser.rb:38:in block in get_route_structure' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/bundler/gems/wadlgen-b4e7f9a10454/lib/wadlgen/route_parser.rb:22:ineach' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/bundler/gems/wadlgen-b4e7f9a10454/lib/wadlgen/route_parser.rb:22:in get_route_structure' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/bundler/gems/wadlgen-b4e7f9a10454/lib/wadlgen/route_parser.rb:13:inparse' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/bundler/gems/wadlgen-b4e7f9a10454/lib/wadlgen.rb:37:in parse_route' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/bundler/gems/wadlgen-b4e7f9a10454/lib/wadlgen.rb:18:ingenerate' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/bundler/gems/wadlgen-b4e7f9a10454/lib/rake/wadlgen.rb:19:in block in <top (required)>' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:205:incall' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:205:in block in execute' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:200:ineach' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:200:in execute' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:158:inblock in invoke_with_call_chain' /Users/svigraham/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in mon_synchronize' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:151:ininvoke_with_call_chain' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:144:in invoke' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:116:ininvoke_task' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:94:in block (2 levels) in top_level' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:94:ineach' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:94:in block in top_level' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:133:instandard_exception_handling' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:88:in top_level' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:66:inblock in run' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:133:in standard_exception_handling' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:63:inrun' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/bin/rake:33:in <top (required)>' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/bin/rake:19:inload' /Users/svigraham/.rvm/gems/ruby-1.9.2-p290@rails31/bin/rake:19:in `

' Tasks: TOP => wadlgen

austvik commented 12 years ago

Hmm, it seems it is not able to read the controller name in this code:

  application.routes.routes.each do |route|
    defaults = route.defaults
    controller = defaults[:controller]

A prettyprint of defaults there where it crashes would be interesting.

jgifford78 commented 12 years ago

I ran into the same error. As I trace down through, it seems that the base variable in the rake task might be the issue. Or rather, incorrectly setting a base in the routes.rb file?

austvik commented 12 years ago

Are any of these projects by any chance open source so that I can try to reproduce myself?

jgifford78 commented 12 years ago

Mine isn't, but I can try and reproduce it on a project that is. If I'm able to, I'll send it back your way. Thanks.

jgifford78 commented 12 years ago

I added wadlgen to a public application. jgifford78\ScoutMaster-Tools

ygoldshtrakh commented 12 years ago

it has to do with an empty defaults. i've submitted a pull request to have it checked