执行rails和rake命令时没有给出错误的块

时间:2011-09-27 16:44:36

标签: ruby-on-rails ruby-on-rails-3

我今天为我的rails应用程序生成了一个新的控制器,我遇到了一个相当令人不安的错误。当我运行rails generate controller Matches时,我收到以下错误:

rails generate controller Matches
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:1075:in `member': no block given (LocalJumpError)
    from /Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:546:in `scope'
    from /Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:1074:in `member'
    from /Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:1260:in `with_scope_level'
    from /Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:1073:in `member'
    from /Users/max/workplace/SummerGypsy/config/routes.rb:34
    from /Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:1011:in `resources'
    from /Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:1269:in `resource_scope'
    from /Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:546:in `scope'
    from /Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:1268:in `resource_scope'
    from /Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:1260:in `with_scope_level'
    from /Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:1267:in `resource_scope'
    from /Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:1010:in `resources'
    from /Users/max/workplace/SummerGypsy/config/routes.rb:33
    from /Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/route_set.rb:233:in `instance_exec'
    from /Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/route_set.rb:233:in `draw'
    from /Users/max/workplace/SummerGypsy/config/routes.rb:1
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:235:in `load'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:235:in `load'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:596:in `new_constants_in'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:235:in `load'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application.rb:127:in `reload_routes!'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application.rb:127:in `each'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application.rb:127:in `reload_routes!'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application.rb:120:in `routes_reloader'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/file_update_checker.rb:32:in `call'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/file_update_checker.rb:32:in `execute_if_updated'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application/finisher.rb:51
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application/finisher.rb:52:in `call'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application/finisher.rb:52
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/initializable.rb:25:in `instance_exec'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/initializable.rb:25:in `run'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/initializable.rb:50:in `run_initializers'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/initializable.rb:49:in `each'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/initializable.rb:49:in `run_initializers'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application.rb:134:in `initialize!'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application.rb:77:in `send'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application.rb:77:in `method_missing'
    from /Users/max/workplace/SummerGypsy/config/environment.rb:5
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:239:in `require'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:239:in `require'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:596:in `new_constants_in'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:239:in `require'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application.rb:103:in `require_environment!'
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/commands.rb:16
    from script/rails:6:in `require'
    from script/rails:6

我完全不知道这意味着什么。运行rake db:migrate

时出现类似错误
rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
no block given
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:1075:in `member'
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:546:in `scope'
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:1074:in `member'
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:1260:in `with_scope_level'
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:1073:in `member'
/Users/max/workplace/SummerGypsy/config/routes.rb:34
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:1011:in `resources'
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:1269:in `resource_scope'
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:546:in `scope'
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:1268:in `resource_scope'
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:1260:in `with_scope_level'
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:1267:in `resource_scope'
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/mapper.rb:1010:in `resources'
/Users/max/workplace/SummerGypsy/config/routes.rb:33
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/route_set.rb:233:in `instance_exec'
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.8/lib/action_dispatch/routing/route_set.rb:233:in `draw'
/Users/max/workplace/SummerGypsy/config/routes.rb:1
/Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:235:in `load'
/Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:235:in `load'
/Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:225:in `load_dependency'
/Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:596:in `new_constants_in'
/Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:225:in `load_dependency'
/Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:235:in `load'
/Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application.rb:127:in `reload_routes!'
/Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application.rb:127:in `each'
/Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application.rb:127:in `reload_routes!'
/Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application.rb:120:in `routes_reloader'
/Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/file_update_checker.rb:32:in `call'
/Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/file_update_checker.rb:32:in `execute_if_updated'
/Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application/finisher.rb:51
/Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application/finisher.rb:52:in `call'
/Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application/finisher.rb:52
/Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/initializable.rb:25:in `instance_exec'
/Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/initializable.rb:25:in `run'
/Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/initializable.rb:50:in `run_initializers'
/Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/initializable.rb:49:in `each'
/Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/initializable.rb:49:in `run_initializers'
/Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application.rb:134:in `initialize!'
/Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application.rb:77:in `send'
/Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application.rb:77:in `method_missing'
/Users/max/workplace/SummerGypsy/config/environment.rb:5
/Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:239:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:239:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:225:in `load_dependency'
/Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:596:in `new_constants_in'
/Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:225:in `load_dependency'
/Library/Ruby/Gems/1.8/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:239:in `require'
/Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application.rb:103:in `require_environment!'
/Library/Ruby/Gems/1.8/gems/railties-3.0.8/lib/rails/application.rb:218:in `initialize_tasks'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:176:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:174:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:157:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.9.2/bin/rake:32
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
Tasks: TOP => db:migrate => environment

我在Ruby 1.8.7(补丁级别249)上运行rails 3.0.8。有没有人有什么建议?谢谢你的帮助。

0 个答案:

没有答案