Exception breakpoints are ignored by RubyMine

I have an application that is throwing the following exception: {NoMethodError} undefined method `[]' for nil:NilClass
I created a Ruby Exception Breakpoint for NoMethodError
When I run the application in Debug mode in RubyMine, the application is not suspended when the exception is raised
What am I missing? I would like the program to be suspended where the exception is raised, so I can see exactly where in the code the exception is being raised.

Is there a different way of doing this? Could I use a Watch instead?

3 comments
Comment actions Permalink

Hi,

such breakpoint is supposed to work, so it looks like a bug for me.
Could you please provide more information: what ruby version are you using, what OS, what kind of app are you debugging (Rails, plain Ruby, something else).
Also could you please enable verbose mode for our debugger (see Settings|Debugger|Ruby) and provide complete content of debug tool window.

Regards, Oleg.

0
Comment actions Permalink

Have exactly the same issue

I've set several Exceptions to do breakpoint - nothing works:

Screen Shot 2015-01-25 at 10.02.53 PM.png

>  Could you please provide more information: what ruby version

ruby 2.0.0p481 (2014-05-08 revision 45883) [i686-linux]

> what OS
rails runs on Ubuntu (Vagrant):

Distributor ID: Ubuntu

Description: Ubuntu 12.04 LTS

Release: 12.04

Codename: precise

RubyMine runs on OsX:

Software:

    System Software Overview:

      System Version: OS X 10.10.1 (14B25)

      Kernel Version: Darwin 14.0.0

      Boot Volume: MacOS

      Boot Mode: Normal

      Secure Virtual Memory: Enabled

      Time since boot: 13 days 20:12


> , what kind of app are you debugging (Rails, plain Ruby, something else).

Rails 4.1.2

> Also could you please enable verbose mode for our debugger (see Settings|Debugger|Ruby) and provide complete content of debug tool window.

/usr/local/bin/ruby -e 'at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)' /home/vagrant/.gem/ruby/2.0.0/gems/ruby-debug-ide-0.4.24/bin/rdebug-ide --debug --disable-int-handler --evaluation-timeout 10 --rubymine-protocol-extensions --port 53740 --dispatcher-port 37668 -- /home/vagrant/ruby-test/bin/rails server -b 0.0.0.0 -p 3000 -e development Fast Debugger (ruby-debug-ide 0.4.24, debase 0.1.1) listens on 127.0.0.1:53740 Connected from 127.0.0.1 5974: Starting control thread 5974: Processing in control: catch Exception 5974: <catchpointSet exception="Exception"/> 5974: Processing in control: catch RuntimeError 5974: <catchpointSet exception="RuntimeError"/> 5974: Processing in control: catch CantUnderstand 5974: <catchpointSet exception="CantUnderstand"/> 5974: Processing in control: catch NoMethodError 5974: <catchpointSet exception="NoMethodError"/> 5974: Processing in control: start 5974: Starting: running program script => Booting WEBrick => Rails 4.1.2 application starting in development on http://0.0.0.0:3000 => Run `rails server -h` for more startup options => Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option) => Ctrl-C to shutdown server [2015-01-26 04:12:17] INFO  WEBrick 1.3.1 [2015-01-26 04:12:17] INFO  ruby 2.0.0 (2014-05-08) [i686-linux] [2015-01-26 04:12:17] INFO  WEBrick::HTTPServer#start: pid=5974 port=3000

<... here goes app-related debug output ...>

Completed 500 Internal Server Error in 327ms
[2015-01-26 04:07:54] ERROR NoMethodError: undefined method `to_entity' for nil:NilClass
     /usr/local/lib/ruby/gems/2.0.0/gems/treat-2.1.0/lib/treat/entities/entity/buildable.rb:104:in `block in from_array'
     /usr/local/lib/ruby/gems/2.0.0/gems/treat-2.1.0/lib/treat/entities/entity/buildable.rb:103:in `each'
     /usr/local/lib/ruby/gems/2.0.0/gems/treat-2.1.0/lib/treat/entities/entity/buildable.rb:103:in `from_array'
     /usr/local/lib/ruby/gems/2.0.0/gems/treat-2.1.0/lib/treat/entities/entity/buildable.rb:49:in `build'
     /usr/local/lib/ruby/gems/2.0.0/gems/treat-2.1.0/lib/treat/core/dsl.rb:12:in `method_missing'
<... here goes app trace ...>
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/abstract_controller/base.rb:189:in `process_action'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_controller/metal/rendering.rb:10:in `process_action'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/callbacks.rb:113:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/callbacks.rb:113:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/callbacks.rb:166:in `block in halting'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/callbacks.rb:166:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/callbacks.rb:166:in `block in halting'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/callbacks.rb:229:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/callbacks.rb:229:in `block in halting'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/callbacks.rb:229:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/callbacks.rb:229:in `block in halting'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/callbacks.rb:166:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/callbacks.rb:166:in `block in halting'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/callbacks.rb:166:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/callbacks.rb:166:in `block in halting'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/callbacks.rb:149:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/callbacks.rb:86:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/callbacks.rb:86:in `run_callbacks'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/abstract_controller/callbacks.rb:19:in `process_action'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_controller/metal/rescue.rb:29:in `process_action'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/notifications.rb:159:in `block in instrument'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/notifications.rb:159:in `instrument'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
     /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.1.2/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/abstract_controller/base.rb:136:in `process'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionview-4.1.2/lib/action_view/rendering.rb:30:in `process'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_controller/metal.rb:196:in `dispatch'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_controller/metal.rb:232:in `block in action'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_dispatch/routing/route_set.rb:82:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_dispatch/routing/route_set.rb:50:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_dispatch/journey/router.rb:71:in `block in call'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_dispatch/journey/router.rb:59:in `each'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_dispatch/journey/router.rb:59:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_dispatch/routing/route_set.rb:678:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/etag.rb:23:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/conditionalget.rb:35:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_dispatch/middleware/flash.rb:254:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
     /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_dispatch/middleware/cookies.rb:560:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.1.2/lib/active_record/query_cache.rb:36:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.1.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.1.2/lib/active_record/migration.rb:380:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/callbacks.rb:82:in `run_callbacks'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_dispatch/middleware/reloader.rb:73:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.1.2/lib/rails/rack/logger.rb:38:in `call_app'
     /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.1.2/lib/rails/rack/logger.rb:20:in `block in call'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/tagged_logging.rb:68:in `block in tagged'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/tagged_logging.rb:26:in `tagged'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/tagged_logging.rb:68:in `tagged'
     /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.1.2/lib/rails/rack/logger.rb:20:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/quiet_assets-1.0.3/lib/quiet_assets.rb:23:in `call_with_quiet_assets'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_dispatch/middleware/request_id.rb:21:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/activesupport-4.1.2/lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/actionpack-4.1.2/lib/action_dispatch/middleware/static.rb:64:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.1.2/lib/rails/engine.rb:514:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.1.2/lib/rails/application.rb:144:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
     /usr/local/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
     /usr/local/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
     /usr/local/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
     /usr/local/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'

0
Comment actions Permalink

As far as I can see you have filed https://youtrack.jetbrains.com/issue/RUBY-16232 about the problem, so let's continue our discussion there.

Regards, Oleg.

0

Please sign in to leave a comment.