0

我正在使用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.
4

1 回答 1

2

您可以通过键入“rails generate”来获取已安装生成器的列表

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

rails generate rspec:model user

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

于 2013-08-21T07:14:52.880 回答