I am running rails 2.1 and cannot get ruby-prof, or more acurately,
the script/performance/request to work.
Installing ruby-prof I get this:
sudo gem install ruby-prof
Building native extensions. This could take a while…
Successfully installed ruby-prof-0.6.0
1 gem installed
Installing ri documentation for ruby-prof-0.6.0…
No definition for prof_get_cpu_frequency
No definition for prof_set_cpu_frequency
Installing RDoc documentation for ruby-prof-0.6.0…
No definition for prof_get_cpu_frequency
No definition for prof_set_cpu_frequency
Which looks like it is having problems in the docs, so ok.
If I run:
script/performance/request lib/prof_scripts/store_browse_profiler.rb
I get:
Warming up once
3.80 sec, 1 requests, 0 req/sec
Profiling 100x gem install ruby-prof to use the profiler
but doing a gem list has:
ruby-prof (0.6.0)
I can run ruby-prof from the command line:
ruby-prof lib/prof_scripts/store_browse_profiler.rb
But it (obviously) doesn’t understand the file as it has a ‘get’ in
it.
Yes, I first uninstalled ruby-prof:
sudo gem uninstall ruby-prof
then did
gem sources -a http://gems.github.com
sudo gem install jeremy-ruby-prof
generated an empty file called prof_script.rb
Get this error:
$ ruby-prof lib/prof_script.rb
/Library/Ruby/Gems/1.8/gems/jeremy-ruby-prof-0.6.1/lib/ruby-prof/
flat_printer.rb:40:in print_methods': wrong argument type Symbol (expected Proc) (TypeError) from /Library/Ruby/Gems/1.8/gems/jeremy-ruby-prof-0.6.1/lib/ruby-prof/ flat_printer.rb:33:in print_threads’
from /Library/Ruby/Gems/1.8/gems/jeremy-ruby-prof-0.6.1/lib/ruby-prof/
flat_printer.rb:32:in each' from /Library/Ruby/Gems/1.8/gems/jeremy-ruby-prof-0.6.1/lib/ruby-prof/ flat_printer.rb:32:in print_threads’
from /Library/Ruby/Gems/1.8/gems/jeremy-ruby-prof-0.6.1/lib/ruby-prof/
flat_printer.rb:26:in `print’
from /Library/Ruby/Gems/1.8/gems/jeremy-ruby-prof-0.6.1/bin/ruby-prof:
171
from /usr/bin/ruby-prof:19
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.