I am new to Ruby on Rails and am working through Patrick Lenz book on
building a rails application, which is very good by the way. I have
gotten through the book with little problem until I reached chapter 11
on Debugging, Testing and Benchmarking. I am using the updated version
of the book from Sitepoint which provides instructions for using
ruby-debug versus breakpoint. I had some trouble installing ruby-debug
but found another posting on this forum where someone ran into the same
problem and provided an answer. So now I have installed
ruby-debug-base-0.9.3-mswin32 and can start mongrel or webrick with the
config file updated to require “ruby-debug-base”. However, when I enter
debugger in the story_controller file which creates a sort of breakpoint
as explained in the book and attempt to submit a new story using the
Shovel application the web browser doesn’t hang at all when I submit a
new story and I can not invoke the debugger. I updated the
story_controller.rb file as specified and provide below:
def new
@story = Story.new(params[:story])
@story.user = @current_user
if request.post? and @story.save
debugger
@story.tag_with params[:tags] if params[:tags]
flash[:notice] = ‘Story submission succeeded’
redirect_to :action => ‘index’
end
end
I also added the following to the config/environments/development.rb
file.
require ‘ruby-debug-base’
Debugger.start
Any insight would be greatly appreciated.