I'm creating a Rails Performance test, as described in the Rails Guide, and I'm having problems with ruby-prof.
I'm using Ruby 1.9.2-p0 (though experienced the same issue on p320) and Rails 3.1.0.
I have a pretty simple test for a controller that is equivalent to this example.
According to the guide, I need to install ruby-prof before I can use performance tests. Sure enough, if I run my performance test without it, I get:
Specify ruby-prof as application's dependency in Gemfile to run benchmarks.
If I follow the guide's instructions to the letter, I add this to my Gemfile:
gem 'ruby-prof', :git => 'git://github.com/wycats/ruby-prof.git'
...and get version 0.11.0 from the wycats repository. When I run my test I get this error:
/Users/craig/.rvm/gems/ruby-1.9.2-p0/bundler/gems/ruby-prof-ffae61a89553/lib/ruby-prof/abstract_printer.rb:44:in `inspect': undefined method `to_s' for #<Class:0x000001025a3f18> (NoMethodError)
from /Users/craig/.rvm/gems/ruby-1.9.2-p0/bundler/gems/ruby-prof-ffae61a89553/lib/ruby-prof/abstract_printer.rb:44:in `full_name'
...
But "wycats" doesn't appear to be the canonical Github repo for ruby-prof. The documentation refers to rdp (Roger Pack). If I use that repo instead:
gem 'ruby-prof', :git => 'git://github.com/rdp/ruby-prof.git'
...I get version 0.11.2, and get this error:
/Users/craig/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.1.0/lib/active_support/testing/performance/ruby.rb:39:in
run': undefined method
values' for [#]:Array (NoMethodError) from /Users/craig/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.1.0/lib/active_support/testing/performance.rb:140:in `run_profile' ...
I get the same error if I just use the gem from rubygems directly (again, version 0.11.2):
gem 'ruby-prof'
Any ideas what's going wrong, or how to resolve it?