我在创建一个新项目时遇到了这个错误,所以我将在哪里添加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$