每当我想生成一个新的控制器时,我都会收到这个错误

时间:2016-11-26 21:56:39

标签: ruby-on-rails

Aikers-MBP:app Aiker$ rails g controller index home
Running via Spring preloader in process 62820
/Users/Aiker/Desktop/app/vendor/bundle/gems/thor-0.19.2/lib/thor/parser/option.rb:130:in `validate_default_type!': An option's default must match its type. (ArgumentError)
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/thor-0.19.2/lib/thor/parser/option.rb:113:in `validate!'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/thor-0.19.2/lib/thor/parser/argument.rb:24:in `initialize'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/thor-0.19.2/lib/thor/parser/option.rb:9:in `initialize'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/thor-0.19.2/lib/thor/base.rb:544:in `new'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/thor-0.19.2/lib/thor/base.rb:544:in `build_option'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/thor-0.19.2/lib/thor/base.rb:278:in `class_option'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/railties-5.0.0.1/lib/rails/generators/base.rb:202:in `class_option'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/railties-5.0.0.1/lib/rails/generators/base.rb:178:in `block in hook_for'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/railties-5.0.0.1/lib/rails/generators/base.rb:168:in `each'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/railties-5.0.0.1/lib/rails/generators/base.rb:168:in `hook_for'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/jbuilder-2.6.0/lib/generators/rails/scaffold_controller_generator.rb:9:in `<class:ScaffoldControllerGenerator>'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/jbuilder-2.6.0/lib/generators/rails/scaffold_controller_generator.rb:6:in `<module:Generators>'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/jbuilder-2.6.0/lib/generators/rails/scaffold_controller_generator.rb:5:in `<module:Rails>'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/jbuilder-2.6.0/lib/generators/rails/scaffold_controller_generator.rb:4:in `<top (required)>'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/jbuilder-2.6.0/lib/jbuilder/railtie.rb:32:in `block in <class:Railtie>'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/railties-5.0.0.1/lib/rails/railtie.rb:230:in `block in run_generators_blocks'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/railties-5.0.0.1/lib/rails/railtie.rb:247:in `each'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/railties-5.0.0.1/lib/rails/railtie.rb:247:in `each_registered_block'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/railties-5.0.0.1/lib/rails/railtie.rb:230:in `run_generators_blocks'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/railties-5.0.0.1/lib/rails/application.rb:453:in `block in run_generators_blocks'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/railties-5.0.0.1/lib/rails/engine/railties.rb:13:in `each'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/railties-5.0.0.1/lib/rails/engine/railties.rb:13:in `each'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/railties-5.0.0.1/lib/rails/application.rb:453:in `run_generators_blocks'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/railties-5.0.0.1/lib/rails/engine.rb:465:in `load_generators'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:144:in `generate_or_destroy'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:60:in `generate'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `<top (required)>'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
    from /Users/Aiker/Desktop/app/bin/rails:9:in `<top (required)>'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `load'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `block in load'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
    from /Users/Aiker/Desktop/app/vendor/bundle/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `load'
    from /Users/Aiker/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/Aiker/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from -e:1:in `<main>'
Aikers-MBP:app Aiker$

0 个答案:

没有答案