rails: IDE debugging of apps on Rails 5.2 broken

Steps to reproduce

See attached development_machine_installation.txt, then follow steps in expected behaviour section development_machine_installation.txt

Expected behavior

In IDE;

  • add break point to first line of [app root]/ config/application.rb; require_relative ‘boot’
  • start debug.
  • debugger should stop at breakpoint

Actual behavior

  • debugger continues without stopping
  • NB: Any breakpoint further into execution of the Rails app fails to halt execution.

Work around;

Edit [app root]/ config/boot.rb Comment out line;

  • require ‘bootsnap/setup’

Debugging now works throughout app as expected.

Notes;

Looking at https://github.com/Shopify/bootsnap/issues/93, I believe this problem occurs due a combination of the following;

NB: The same problem is occurring in a number of IDE’s;

I believe this is a Ruby + Bootsnap issue rather than Rails, however, I’m wondering if a change to the Rails boot.rb could be used to workaround the issue for IDE developers via a test for a debug environment variable?

Also, I wanted to log the problem with a clear title so other Rails developers using IDE’s will know what is going on, rather than spending time on searching for answers

(Apologies if my shotgun approach to submitting this issue on multiple repos is poor-form. I’m new to open-source development)

System configuration

  • vscode-ruby version: 0.18.0
  • Ruby version: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
  • Rails version: 5.2.0
  • ruby-debug-ide version: 0.6.1
  • debase version: 0.2.2
  • VS Code version: 1.22.2 (1.22.2)
  • Operating System: macOS 10.13.4 (17E199)
  • Hardware (optional): MacBook Pro (13-inch, Mid 2012) & MacBook (13-inch, Mid 2010)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

I’m sorry if this is a bit inappropriate to do but I’ve wasted an hour trying to find a solution to my project not debugging.

  • if your Rails 5.2 debugging or debugger is not working on your IDE (RubyMine, VSCode, etc)

  • You have to know that there is a problem with bootsnap+Rails so just comment out the ‘require ‘bootsnap/setup’’ from the boot.rb

PS: I just want this page to be found by others easier because it solved my issue and it’s been very hard to find.