-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IDE debugging of apps on Rails 5.2 broken #146
Comments
@grumBit Did you try the workaround, which is described in the ticket (https://youtrack.jetbrains.com/issue/RUBY-20684) |
I tried the earlier comment to not use bootsnap - https://youtrack.jetbrains.com/issue/RUBY-20684#comment=27-2669909, by commenting out bootsnap in boot.rb as per "Work around" above. I didn't try the second comment to use an alternate debase gem - https://youtrack.jetbrains.com/issue/RUBY-20684#comment=27-2773671 For my purposes, not using bootsnap at all is good enough. Would it help you, for me to try the alternate debase gem? Because it took me sometime (possibly because I'm new to Rails), I was wondering if a workaround built into ruby-debug-ide on master would help other folks moving to rails 5.2 from going through the same pain of investigating & working around this problem. |
@grumBit This fix does not seem to me successful enough for merging it into master (and yes it would be very good if you tried the second approach) |
I totally agree the workaround I've used is not appropriate for merging into ruby-debug-ide. It's just good enough for my purposes (i.e. learning rails). I'll try using the alternate debase gem and let you know how I go. |
@ViugiNick I installed the alternate debase into my environment, and it did allow the debugger to work. However, I needed to start using Bundler in order to directly install a gem from a github branch. Alternatively, I could have; cloned the repo, checked-out the branch, built the gem, and installed the gem. Either way, the workaround being on a branch means getting it to work in some environments is tricky. Also, using the alternate debase means manually editing Given the above, what do you think of using the alternate debase as a workaround? For my purposes, it's easier to just comment out bootsnap from boot.rb. These are the steps I used to get the alternate debase working;
|
@ViugiNick I've just put 2 & 2 together and noticed it's your branch on the debase repo for the workaround! Does this mean you might be merging it into master? If so, that would make the workaround much easier for people to adopt. |
@ViugiNick +1 Do you have any idea if your quick fix for |
Here is how I got it working on Rails 5.2 and ruby 2.5.1p57 # config/boot.rb
[...]
require 'bootsnap/setup' unless ENV['RUBY_DEBUG_IDE'] == 'true' And launching my debugger with `RUBY_DEBUG_IDE=true`` For those using VS Code here is my configuration {
"name": "Rails server",
"type": "Ruby",
"request": "launch",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/bin/rails",
"args": ["server"],
"useBundler": true,
"pathToBundler": "/Users/<username>/.rvm/gems/ruby-2.5.1/wrappers/bundle",
"env": { "RUBY_DEBUG_IDE": true }
}, Note that if you use |
One more possible workaround but without additional environment variable: # config/boot.rb
[...]
unless defined?(Debugger)
require 'bootsnap/setup' # Speed up boot time by caching expensive operations.
end
[...] |
@ycherniavskyi Your workaround is very nice! Thank you :). |
@ycherniavskyi It would appear the underlying Ruby issue is fixed in 2.5.2 (ruby/ruby@b85b10c). Given the problem only existed on Ruby versions 2.5.0 through 2.5.1., perhaps the following workaround would be a keeper? # config/boot.rb
[...]
unless ( (('2.5.0'..'2.5.1').include? RUBY_VERSION) && defined?(Debugger) )
require 'bootsnap/setup' # Speed up boot time by caching expensive operations.
end
[...] |
(will fix at least ruby-debug#69 ruby-debug#66 ruby-debug#64 ruby-debug/ruby-debug-ide#146 )
(will fix at least #69 #66 #64 ruby-debug/ruby-debug-ide#146 )
Your environment
vscode-ruby
version: 0.18.0Expected behavior
In IDE;
require_relative 'boot'
Actual behavior
Work around;
Edit [app root]/ config/boot.rb
Comment out line;
Debugging now works throughout app as expected.
Notes;
Looking at Shopify/bootsnap#93, I believe this problem occurs due a combination of the following;
trace
instructions" (https://bugs.ruby-lang.org/issues/14104)NB: The same problem is occurring in other IDE's;
I don't believe this is a ruby-debug-ide issue itself, however, I'm wondering if a change to ruby-debug-ide could address the issue for developers using IDE's?
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)
Steps to reproduce the problem
See attached development_machine_installation.txt, then follow steps in expected behaviour section above.
development_machine_installation.txt
The text was updated successfully, but these errors were encountered: