测试 rake test:benchmark 测试总是报错

seeyoup · 2013年04月22日 · 最后由 seeyoup 回复于 2013年04月22日 · 2546 次阅读

我创建了一个基本的应用,控制器 news,默认 root 为"news/index",使用 http://localhost:3000/可以直接访问到新闻:

在 test/performance 中新建了 homepage_test.rb

require 'test_helper' require 'rails/performance_test_help'

class HomepageTest < ActionDispatch::PerformanceTest # Refer to the documentation for all available options # self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory] # :output => 'tmp/performance', :formats => [:flat] }

def test_homepage get '/' end

end

在应用程序目录运行 rake test:benchmark 总是报错,不知道问题出在哪里了。

Specify ruby-prof as application's dependency in Gemfile to run benchmarks.

知道原因了,需要 gem ruby-prof

需要 登录 后方可回复, 如果你还没有账号请 注册新账号