8

I'm following this railscast on performance testing, but I'm immediately running into an issue.

My app is rails 3.2.11, so according to the railscast it should include performance testing, but I don't have a folder called 'test' at all. When I run 'rails generate performance_test homepage' nothing happens or is generated. So I created one manually (to exactly match the railscast source code), but when I run rake test:benchmark I get the error

 Don't know how to build task 'test:benchmark'

If I add the 'rails-perftest' gem to my gemfile and run bundle, then again try to generate a performance_test nothing happens, and when I then run rake test:benchmark, it throws a different error of

uninitialized constant Rails::SubTestTask

I've been sure to include the following dependencies in my gem file:

 gem 'ruby-prof', group: :test
 gem 'test-unit', group: :test

Could anyone help advise me what I'm doing wrong? Thanks!

4

1 回答 1

1

我对此不是 100% 确定的,但我猜你可能没有相应地配置你的 application.rb 文件。还要检查您的Gemfile.lock文件并运行该命令bundle install,因为它也可能与您的 Gem 和依赖项有关。

于 2014-10-12T13:35:58.337 回答