Why does minitest throw OptionParse :: InvalidOption when rails generate starts with parameters?

Whenever the Rails generator starts with one or more parameters, the mintiest raises OptionParse::InvalidOption .

I am using Rails 3.1, Ruby 1.9.2-p290 and Mintest 2.10.0.

The generate command actually starts and processes the passed parameters, but Minitest throws an exception and a stack trace at the end:

 rails generate model x --no-migration -s -p invoke active_record identical app/models/x.rb invoke test_unit identical test/unit/x_test.rb identical test/fixtures/xs.yml /Users/max/.rvm/gems/ruby-1.9.2-p290/gems/minitest-2.10.0/lib/minitest/unit.rb:900:in 'block in process_args': invalid option: --no-migration (OptionParser::InvalidOption) from /Users/max/.rvm/gems/ruby-1.9.2-p290/gems/minitest-2.10.0/lib/minitest/unit.rb:879:in 'new' from /Users/max/.rvm/gems/ruby-1.9.2-p290/gems/minitest-2.10.0/lib/minitest/unit.rb:879:in 'process_args' from /Users/max/.rvm/gems/ruby-1.9.2-p290/gems/minitest-2.10.0/lib/minitest/unit.rb:929:in '_run' from /Users/max/.rvm/gems/ruby-1.9.2-p290/gems/minitest-2.10.0/lib/minitest/unit.rb:922:in 'run' from /Users/max/.rvm/gems/ruby-1.9.2-p290/gems/minitest-2.10.0/lib/minitest/unit.rb:690:in 'block in autorun' 

Has anyone else come across this?

+6
source share
1 answer

As stated in the log, there is no such option --no-migration (which, as I understand it, should be available), and therefore you get an error. Try --skip-migration

0
source

Source: https://habr.com/ru/post/904558/


All Articles