Ananth Kollipara
2014-May-07 14:49 UTC
rails session hangs on hitting debugger line of code
Hi - Am using ruby-debug gem. When i run my rails application, once the
control reaches the 'debugger' line, the entire session hangs. I cannot
type or execute any commands further. Can i get some help here?
My code:
~~~~~~~~
require 'ruby-debug'
module Rearview
class MonitorController < Rearview::ApplicationController
before_action only: [:create] do
clean_empty_array_vals(:metrics)
end
#
# TODO this should be moved to the JobsController#test and the UI
changed to push the
# monitor job model instead of custom params
#
def create
@errors = if params[:metrics].empty?
Rails.logger.debug("ANANTH1:: errors obj:: #{@errors.inspect}")
[ "No metrics were provided" ]
else
metrics_validator =
Rearview::MetricsValidator.new({attributes: [:metrics]})
params[:metrics].inject([]) { |a,v| a << "Metrics
contains an invalid metric: #{v}"
unless(metrics_validator.metric_valid?(v)); a }
end
*debugger*
results = if @errors.empty?
Rails.logger.debug("ANANTH2:: results obj::
#{@results.inspect}")
Rails.logger.debug("ANANTH3:: #{:metrics}")
Rearview::MonitorRunner.run(params[:metrics],params[:monitorExpr],params[:minutes],{},false,params[:toDate],true)
else
{ }
end
@monitor_output = Rearview::MonitorRunner.normalize_results(results)
Rails.logger.debug("ANANTH4:: monitor_output obj::
#{@monitor_output.inspect}")
end
end
end
~~~~~~~~~~~~~~~
*Session hangs here.....*
*---------------------------------------*
/usr/local/rvm/gems/jruby-1.7.12/gems/ruby-debug-base-0.10.4-java/lib/ruby-debug-base.rb:214
warning: tracing (e.g. set_trace_func) will not capture all events without
--debug flag
/usr/local/rvm/gems/jruby-1.7.12/gems/rearview-1.2.1-java/app/controllers/rearview/monitor_controller.rb:23
results = if @errors.empty?
(rdb:1)
*---------------------------------------*
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/94c698be-9ebd-4f37-9766-cd25cf39bd72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.