-
-
Notifications
You must be signed in to change notification settings - Fork 328
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
Can't start remote debug server undefined method `wait_connection=' for Byebug:Module (NoMethodError) #185
Comments
to help: i've discovered that: require 'byebug/core'
Byebug.wait_connection = true
Byebug.start_server('localhost', 8989) works. and if you try: require 'byebug'
debugger
Byebug.wait_connection = true
Byebug.start_server('localhost', 8989) works too. It works because "debugger" calls: Byebug.attach(https://github.com/deivid-rodriguez/byebug/blob/master/lib/byebug/attacher.rb), which calls require 'byebug/core' which requires the remote part. I wonder if: https://github.com/deivid-rodriguez/byebug/blob/master/lib/byebug.rb should require 'byebug/core' ? |
Indeed. This was changed in b77855c to speed up library loading. I didn't notice that it would break remote debugging. I thinking we could add another kernel method
For now, follow @guilherme's fix! 😃 |
👍 |
I had a hard time launching the remote debugger ONLY when I wanted it launched. It was further complicated that I got some other error when calling 'debugger' as one of the previous posters mentioned. This is what I had to do, in order to start the debugger on a multi-process unicorn and connect to it with the byebug remote client. I added the following to the class under test. The order of the requires was important. Using the :: to denote top level class was also important.
Now to trigger the debugger where I wanted it also in this class. I couldn't call 'debugger' here. I had to ::Byebug.byebug to avoid that naming conflict. This was deep in a mailer view with Rails and Devise.
I really wish the remote debugger server and client were reversed, or were supported in such a fashion. Such that I could just start the debugger cli listening at a specific port and it would wait until the app contacted it, it could debug then when done wait for the next debugger call. Then in the app when triggering a breakpoint, it connects to the cli. That way it wouldn't matter which process was being debugged. |
I was able to revise my hack
then later
which spits out something like
|
This was improved via #406. Now you can use |
When I try to start the remote server following the guide I get the following with every version of byebug > 5.x:
relevant code:
The text was updated successfully, but these errors were encountered: