Friday, July 15, 2011

Installing Ruby Debug

1) From the root of the project run:
gem install ruby-debug19 -- --with-ruby-include="$rvm_path/src/$(rvm tools identifier)/"

2) Include in Gemfile

group :test, :development do
gem ‘ruby-debug19′, :require => ‘ruby-debug’
end

3) Create a .rdebugrc in your home directory

set autolist
set autoeval
set autoreload
set forcestep


4)
Specify how you would like Rails to report deprecation notices for your bugger environment, set
config.active_support.deprecation to :log, :notify or :stderr at config/environments/bugger.rb


5) require 'ruby-debug' in development.rb. Edit source where you want to debug to include :

debugger

6) Start server in debug mode:
rails s -d

References

http://pivotallabs.com/users/chad/blog/articles/366-ruby-debug-in-30-seconds-we-don-t-need-no-stinkin-gui-
http://bashdb.sourceforge.net/ruby-debug.html
http://railscasts.com/episodes/54-debugging-with-ruby-debug