我无法使用" rails new blog"创建新的应用程序。

时间:2016-11-27 09:32:30

标签: ruby-on-rails ruby ruby-on-rails-4 rvm

我在创建一个新项目时遇到了这个错误,所以我将在哪里添加thor gem版本,如给定的重复问题所述。

当我尝试创建新的rails应用程序时,我收到此错误。我在运行命令rails -v

时也遇到同样的错误
umesh@umesh-Lenovo-G570:~/work/practice$ rails new blog
/home/umesh/.rvm/gems/ruby-2.3.1/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 /home/umesh/.rvm/gems/ruby-2.3.1/gems/thor-0.19.2/lib/thor/parser/option.rb:113:in `validate!'
    from /home/umesh/.rvm/gems/ruby-2.3.1/gems/thor-0.19.2/lib/thor/parser/argument.rb:24:in `initialize'
    from /home/umesh/.rvm/gems/ruby-2.3.1/gems/thor-0.19.2/lib/thor/parser/option.rb:9:in `initialize'
    from /home/umesh/.rvm/gems/ruby-2.3.1/gems/thor-0.19.2/lib/thor/base.rb:544:in `new'
    from /home/umesh/.rvm/gems/ruby-2.3.1/gems/thor-0.19.2/lib/thor/base.rb:544:in `build_option'
    from /home/umesh/.rvm/gems/ruby-2.3.1/gems/thor-0.19.2/lib/thor/base.rb:278:in `class_option'
    from /home/umesh/.rvm/gems/ruby-2.3.1/gems/railties-4.2.6/lib/rails/generators/base.rb:202:in `class_option'
    from /home/umesh/.rvm/gems/ruby-2.3.1/gems/railties-4.2.6/lib/rails/generators/app_base.rb:71:in `add_shared_options_for'
    from /home/umesh/.rvm/gems/ruby-2.3.1/gems/railties-4.2.6/lib/rails/generators/rails/app/app_generator.rb:160:in `<class:AppGenerator>'
    from /home/umesh/.rvm/gems/ruby-2.3.1/gems/railties-4.2.6/lib/rails/generators/rails/app/app_generator.rb:159:in `<module:Generators>'
    from /home/umesh/.rvm/gems/ruby-2.3.1/gems/railties-4.2.6/lib/rails/generators/rails/app/app_generator.rb:153:in `<module:Rails>'
    from /home/umesh/.rvm/gems/ruby-2.3.1/gems/railties-4.2.6/lib/rails/generators/rails/app/app_generator.rb:3:in `<top (required)>'
    from /home/umesh/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /home/umesh/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /home/umesh/.rvm/gems/ruby-2.3.1/gems/railties-4.2.6/lib/rails/commands/application.rb:2:in `<top (required)>'
    from /home/umesh/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /home/umesh/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /home/umesh/.rvm/gems/ruby-2.3.1/gems/railties-4.2.6/lib/rails/cli.rb:14:in `<top (required)>'
    from /home/umesh/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /home/umesh/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /home/umesh/.rvm/gems/ruby-2.3.1/gems/railties-4.2.6/bin/rails:9:in `<top (required)>'
    from /home/umesh/.rvm/gems/ruby-2.3.1/bin/rails:23:in `load'
    from /home/umesh/.rvm/gems/ruby-2.3.1/bin/rails:23:in `<main>'
    from /home/umesh/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'
    from /home/umesh/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'
umesh@umesh-Lenovo-G570:~/work/practice$ 

1 个答案:

答案 0 :(得分:0)

您使用的thor gem版本存在问题。

有关详细信息,请查看here。这个问题是重复的。