-
-
Notifications
You must be signed in to change notification settings - Fork 136
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 get it to work together with pry-remote #33
Comments
Hi @brauliomartinezlm ! As I commented here, it's in my TODO list to review compatibility with Cheers! |
@deivid-rodriguez thanks a lot! I try to help if I have some spare time. |
Great!! |
I experience the same issue, if pry-remote even works at all. Sometimes I get the behaviour described in this ticket: Mon-Ouie/pry-remote#58 In that case pry-remote does not work at all, showing the context of the PryRemote::Server#run method in the rails server log rather than dropping in the pry-remote command. |
👍 this is pretty huge for me. I love pry-byebug a lot but I can't use it locally since I have to test with Unicorn. |
👍 Same issue for me (using a Vagrant image locally for development) Is there some way I/we (everyone with this issue) could help with getting this compatibility added? |
Using the latest version
|
Clone/fork both repos and start researching. If you need help let me know. 👍 |
pry-byebug version 1.3.3 works great with pry-remote, so I'm pinned there for now. |
Pry ByeBug > `2.0.0` conflicts with Pry Remote. This pin is necessary until the conflict is solved. See: * [deivid-rodriguez/pry-byebug#33](deivid-rodriguez/pry-byebug#33) * [Mon-Ouie/pry-remote#58](Mon-Ouie/pry-remote#58) This commit closes #3
This helped us get running again. Thank you @nessur. |
👍 |
👍 I'm still seeing this issue with pry-byebug. I'd love to see an update that lets them work together. |
Any traction on this issue? I am not getting any love from pry-byebug v.1.3.3, v.3.1, v.3.3 with POW and pry-remote v.0.1.8 |
Nope. |
Ok, unless it is really necessary to use pry-remote--e.g. you are doing some pair programming with someone in another city, there is a work around in regard to getting pry-byebug working with POW.
...doing above from your app directory. I am doing this with
and it is working great. And now I am back to having functionality of pry from pry-byebug, And the pair programming option with POW and byebug is still available with this configuration that Starr Horne came up with:
...then:
from command line and you're right as rain. You would just use the normal symlink in ~/.pow in the second example. Cheers! |
@nessur's fix (using version 1.3.3) works for me: rails (5.0.0.1) |
@deivid-rodriguez have you got any news about compatibility pry-byebug with pry-remote? It's running very well with pry-byebug(version 1.3.3) but I wanna update the gems later. |
Any thoughts here? We're seeing the same issue with pry-byebug 1.3.3, byebug 2.7.0 and pry-remote 0.1.8. For what it's worth here is the exact output we're seeing: [2] pry(#<Frontend>)> next
From: /usr/local/bundle/gems/pry-remote-0.1.8/lib/pry-remote.rb @ line 211 PryRemote::Server#run:
206: def run
207: setup
208:
209: Pry.start(@object, @options.merge(:input => client.input_proxy, :output => client.output))
210: ensure
=> 211: teardown
212: end It's like it is Unfortunately pry-remote is the best (only?) solution for using pry in a docker-compose setup with multiple ruby applications in the stack. It would be great if it worked well. |
WorkaroundUse You don't need It's not well documented, but it works. See Nicholas Gronow's instructions on SO: https://stackoverflow.com/a/25823241/567762 |
This issue is four years old and the problem described by @brauliomartinezlm, @jeffutter and others is still present. |
I just ran into this issue with pry-byebug 8.2.4 and pry-remote 0.1.8. |
Same. So far the only solution is use |
@deivid-rodriguez 👋 I took a look at this and bisected the issue down to 49de00c. That's the first bad commit where pry-remote no longer works. I guess that probably doesn't help a lot because unfortunately lots of changes have happened since then so I'm not really sure where to go from here to help track this issue down. |
@chrisarcand Thanks for investigating. Unfortunately I can't seem to find time & will to have a look at this... 😞 Sorry. The commit you point to is also the cause of other issues users of this gem usually find, specially pry users. I suggest you have a look at #75. Maybe if you rebase that and get it working against latest master, issues will be fixed, since that PR basically makes the behavior introduced by the offending commit optional. |
I have the same problem with pry-byebug 3.6.0 and pry-remote 0.1.8. One thing I found out is that changing the value in
but with
Note: step_out 4 is the same line reported in the discussion above. There is one more thing, although it might be just my setup (I guess it may influence the order the gems are loaded). When debugging I wasn't really able to bind into I don't really know enough about pry or byebug to go further with it. This is the first time I'm contributing on GH so I hope I'm not making any blatant mistakes. Thanks for doing this, @deivid-rodriguez |
Thank you so much @sloneorzeszki. I find your comment quite insightful and useful. Congrats for your first contribution! Changing |
Thanks, @atd :) If enough people confirm that changing the number to 5 fixes the problem I guess we can assume that's the way to go. It maybe sounds like a bad idea (since we would have to set a different number for every gem having similar problem), but with pry-remote we already have the I too have a problem thinking about any good-looking solution but I made a fix that works for me - hopefully someone will be able to make something better of it. It's available on my fork - Few remarks:
I didn't make a pull request out of it due to above caveats. I will be happy to make it if needed :) |
Thanks for all your investigations! I'll try to find some time to look at this! 👍 |
Thank you for sharing your branch @sloneorzeszki I have tested it, but I still get the input inside the wrong terminal (the one with the Regarding your comments, you should be able to enclose the About using Finally, you can pass the |
It was the first time I used this gem, I honestly didn't realize this was the problem (although I did find it pretty odd 😶), I was focused on the step_out thing only. Thank you for your feedback, will look into it in the coming days :) |
@atd I applied your suggestions and pushed to my fork (https://github.com/sloneorzeszki/pry-byebug/commit/33d4ba2536a68221ac8c08797b06af5bec5fcaab). Unfortunately I wasn't able to fix the wrong terminal problem even though I spent a few hours on it. Hopefully someone else will be able to go on with that. Thanks again for help. |
Part of the problem stems from pry-byebug alias-method-chaining The alias-method-chain ( def start_with_pry_byebug(target = TOPLEVEL_BINDING, options = {})
Byebug::PryProcessor.start unless ENV['DISABLE_PRY']
# ^ options not conveyed here The call to the original def resume_pry
run do
@pry = Pry.start_without_pry_byebug(new_binding)
# ^ options not conveyed here @JoshCheek posted a hacky fix in #45 (here) as a proof of concept. But I think the idiomatic thing would be to write a companion class to diff --git a/lib/byebug/interfaces/pry_interface.rb b/lib/byebug/interfaces/pry_interface.rb
new file mode 100644
index 0000000..74e410d
--- /dev/null
+++ b/lib/byebug/interfaces/pry_interface.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+require "byebug/core"
+
+module Byebug
+ class PryInterface < LocalInterface
+ attr_accessor :options
+
+ def initialize(options)
+ super()
+ @options = options
+ end
+ end
+end
diff --git a/lib/byebug/processors/pry_processor.rb b/lib/byebug/processors/pry_processor.rb
index 5f29cfd..eb75bfd 100644
--- a/lib/byebug/processors/pry_processor.rb
+++ b/lib/byebug/processors/pry_processor.rb
@@ -1,6 +1,7 @@
# frozen_string_literal: true
require "byebug/core"
+require "byebug/interfaces/pry_interface"
module Byebug
#
@@ -13,10 +14,11 @@ module Byebug
def_delegators :@pry, :output
def_delegators Pry::Helpers::Text, :bold
- def self.start
+ def self.start(options = {})
Byebug.start
Setting[:autolist] = false
Context.processor = self
+ Context.interface = PryInterface.new(options)
Byebug.current_context.step_out(4, true)
end
@@ -114,7 +116,7 @@ module Byebug
if defined?(@pry) && @pry
@pry.repl(new_binding)
else
- @pry = Pry.start_without_pry_byebug(new_binding)
+ @pry = Pry.start_without_pry_byebug(new_binding, interface.options)
end
end
end
diff --git a/lib/pry-byebug/pry_ext.rb b/lib/pry-byebug/pry_ext.rb
index 03c3400..1882e88 100644
--- a/lib/pry-byebug/pry_ext.rb
+++ b/lib/pry-byebug/pry_ext.rb
@@ -7,7 +7,7 @@ class << Pry
def start_with_pry_byebug(target = TOPLEVEL_BINDING, options = {})
if target.is_a?(Binding) && PryByebug.file_context?(target)
- Byebug::PryProcessor.start unless ENV["DISABLE_PRY"]
+ Byebug::PryProcessor.start(options) unless ENV["DISABLE_PRY"]
else
# No need for the tracer unless we have a file context to step through
start_without_pry_byebug(target, options) Having a decoupled class to maintain upstream |
Anybody have traction on this issue? I'm using pry-remote standalone, but would really like to navigate! |
I've found a way to make it work and opened an MR here #339. |
For anyone who's interested, @meinac's fix has been released as a forked version of this gem: https://rubygems.org/gems/gitlab-pry-byebug/versions/3.9.0 |
Thanks @thiago-gitlab that's awesome. Is this fork receiving updates? I see it's pinned to the 0.13.0 version of Pry, which has moved up to 0.14.0 |
@kylesnowschwartz, it's not because we were hoping that upstream would be eventually fixed. The MR has been open for a few months without any comments, so that hasn't happened yet. Our fork is here: https://gitlab.com/gitlab-org/gitlab-pry-byebug/-/tree/release_new_version If anyone feels like contributing an update, I'm sure @meinac would be happy to review it. |
I'm using Pow and use pry-remote to attach to the process and evaluate things. So I needed to navigate through the code and then I added pry-byebug. But when I run next or step commands where binding.remote_pry stops, it takes me to this ensure block from pry-remote, so I think something must be going wrong here... I'm new with the whole pry toolset so sorry if this is not an issue.
Thanks in advance!
The text was updated successfully, but these errors were encountered: