Installation of railsbench on Windows
- run from any directory (no download required) gem install hoe (this installs dependency gem hoe).
- Download railsbench gem from RubyForge and run gem install railsbench-0.9.2.gem from the directory where it is downloaded.
- Run gem list to see railsbench version 0.9.2 listed.
Running railsbench on Windows
- Set environment variable RAILS_ROOT through control panel to point to your app directory (here guitarati)
RAILS_ROOT set to C:\InstantRails\rails_apps\guitarati - Railsbench writes the result of tests in RAILS_PERF_DATA directory. Set environment variable RAILS_PERF_DATA through control panel. I chose to save the data in a newly created directory perf_data under RAILS_ROOT.
RAILS_PERF_DATA set to C:\InstantRails\rails_apps\guitarati\perf_data - Copy benchmarks.yml and benchmarking.rb from C:\InstantRails\ruby\lib\ruby\gems\1.8\gems\railsbench-0.9.2\config to RAILS_ROOT\config
- Copy benchmarking.rb from C:\InstantRails\ruby\lib\ruby\gems\1.8\gems\railsbench-0.9.2\config to RAILS_ROOT\config\environments
- run railsbench install from C:\InstantRails\ruby\lib\ruby\gems\1.8\gems\railsbench-0.9.2 directory. Should output .. creating database configuration: benchmarking
- Edit environment.rb to specify the plugins to be loaded:
config.plugins = %W( simple_captcha acts_as_ferret …etc…). Without this, running railsbench perf_run gives undefined method errors for me. - Run the simplest railsbench command
C:\…\1.8\gems\railsbench-0.9.2>railsbench perf_run 100 - The above command prints something like this
- Understanding the railsbench results is a topic in itself to be covered in a later blog post.
