在rails 4.0中,无法运行“rails generate rspec <users>”命令</users>

时间:2013-08-21 06:53:39

标签: ruby-on-rails rspec generator

我正在使用rails 4.0。

我正在尝试使用以下命令创建一个rspec文件

$ rails generate rspec static_pages

但是此命令不起作用,它显示在下面错误

DEPRECATION WARNING: config.whiny_nils option is deprecated and no longer works. (called   from block in <top (required)> at   /home/shruthi/Projects/samples/tutorials/config/environments/development.rb:10)
config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:

* development - set it to false
* test - set it to false (unless you use a tool that preloads your test environment)
* production - set it to true

Could not find generator rspec.

1 个答案:

答案 0 :(得分:2)

您可以输入“rails generate”

来获取已安装的生成器列表

要为用户模型生成spec文件,请尝试:

rails generate rspec:model user

正如此处https://www.relishapp.com/rspec/rspec-rails/docs/generators和此处https://github.com/rspec/rspec-rails

所述