2015-09-13 11 views
6

Sto provando a creare una nuova app utilizzando rails-api. Quando eseguo rails-api new mynewapp ricevo il seguente:Thor Argomento Errore durante il tentativo di creare una nuova app Rails

/Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1.1/lib/thor/parser/option.rb:125:in `validate_default_type!': An option's default must match its type. (ArgumentError) 
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1.1/lib/thor/parser/option.rb:111:in `validate!' 
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1.1/lib/thor/parser/argument.rb:24:in `initialize' 
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1.1/lib/thor/parser/option.rb:9:in `initialize' 
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1.1/lib/thor/base.rb:544:in `new' 
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1.1/lib/thor/base.rb:544:in `build_option' 
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1.1/lib/thor/base.rb:274:in `class_option' 
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/generators/base.rb:202:in `class_option' 
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/generators/app_base.rb:71:in `add_shared_options_for' 
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/generators/rails/app/app_generator.rb:160:in `<class:AppGenerator>' 
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/generators/rails/app/app_generator.rb:159:in `<module:Generators>' 
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/generators/rails/app/app_generator.rb:153:in `<module:Rails>' 
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/generators/rails/app/app_generator.rb:3:in `<top (required)>' 
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require' 
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require' 
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rails-api-0.4.0/lib/rails-api/generators/rails/app/app_generator.rb:2:in `<top (required)>' 
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require' 
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require' 
from /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rails-api-0.4.0/bin/rails-api:3:in `<top (required)>' 
from /Users/sandy/.rbenv/versions/2.2.2/bin/rails-api:23:in `load' 
from /Users/sandy/.rbenv/versions/2.2.2/bin/rails-api:23:in `<main>' 

ottengo lo stesso errore esatto quando prova rails new mynewapp, tranne che invece di

...gems/rails-api-0.4.0/bin/rails-api:3:in `<top (required)>' 

ottengo

...gems/railties-4.2.4/bin/rails:9:in `<top (required)>' 

E anche in esecuzione rails -v dà lo stesso errore.

Google non è stato di aiuto. Qualcuno ha idea di cosa potrebbe causare questo?

+0

puoi inserire l'output di 'gem list' del pacchetto corrente in modo da poter vedere la versione di gem installata? – illusionist

+0

Possibile duplicato di [Errore "'Convalida \ _default \ _type!": L'opzione predefinita di un sistema deve corrispondere al tipo (ArgumentError) "quando si esegue Ruby on Rails generate su Windows] (http://stackoverflow.com/questions/40823526/error -Validate-default-tipo-an-opzioni-default-must-match-suo-tipo-argume) –

risposta

0

Se si esegue rails -v e si verifica un errore, l'installazione probabilmente non è corretta. Mi piacerebbe provare rotaie reinstallare ...

Seguire questo: http://installrails.com/

0

Sembra Thor 0.19.1.1 fatto un cambiamento di rottura. Prova a cambiarlo a 0.19.1 e vedere se questo risolve il problema.