Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 3 轨道3.2。为现有模型创建测试。脚手架错误_Ruby On Rails 3_Unit Testing_Testing_Scaffolding - Fatal编程技术网

Ruby on rails 3 轨道3.2。为现有模型创建测试。脚手架错误

Ruby on rails 3 轨道3.2。为现有模型创建测试。脚手架错误,ruby-on-rails-3,unit-testing,testing,scaffolding,Ruby On Rails 3,Unit Testing,Testing,Scaffolding,我想使用rails-3.2脚手架为现有模型生成tests::Unit 我尝试了几个命令,但出现以下错误: invoke active_record The name 'MyModel' is either already used in your application or reserved by Ruby on Rails. Please choose an alternative and run this generator again. 我使用了以下命

我想使用rails-3.2脚手架为现有模型生成tests::Unit

我尝试了几个命令,但出现以下错误:

  invoke  active_record

  The name 'MyModel' is either already used in your application or reserved by         
  Ruby on Rails. Please choose an alternative and run this generator again.
我使用了以下命令,结果相同:

rails g scaffold MyModel --skip
rails g scaffold MyModel -s
rails g scaffold MyModel -t -s
我还尝试使用gem为scaffold指向所有MyModel字段,但没有结果

rails generate scaffold MyModel fio:string #..all fields of my model..# -s

提前谢谢

它应该使用-s选项